From 41e202d533820a7267e09e6c6621dd9cfe5dbb30 Mon Sep 17 00:00:00 2001
From: Nicolas Delaby <nicolas@nexedi.com>
Date: Wed, 15 Dec 2010 16:03:23 +0000
Subject: [PATCH] test render_odt_variable for CheckBoxField

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41468 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/tests/testFields.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/product/ERP5Form/tests/testFields.py b/product/ERP5Form/tests/testFields.py
index 279724ad15..716374f222 100644
--- a/product/ERP5Form/tests/testFields.py
+++ b/product/ERP5Form/tests/testFields.py
@@ -415,6 +415,16 @@ class TestCheckBoxField(ERP5TypeTestCase):
                       self.field.render_odt(as_string=False, REQUEST=self.portal.REQUEST).tag)
     self.assertEquals('1', self.field.render_odt(as_string=False, REQUEST=self.portal.REQUEST).text)
 
+  def test_render_odt_variable(self):
+    for value in (True, False,):
+      self.field.values['default'] = value
+      node = self.field.render_odt_variable(as_string=False)
+      self.assertEquals(node.get('{%s}value-type' % NSMAP['office']),
+                            'boolean')
+      self.assertEquals(node.get('{%s}boolean-value' % NSMAP['office']),
+                        str(value).lower())
+      self.assertEquals(node.text, str(value).upper())
+
 class TestListField(ERP5TypeTestCase):
   """Tests List field
   """
-- 
2.30.9