From ae39d7767a5b7a68783e8f19b3a6cc8b55c79abc Mon Sep 17 00:00:00 2001
From: Nicolas Delaby <nicolas@nexedi.com>
Date: Fri, 4 Dec 2009 10:48:25 +0000
Subject: [PATCH] Check none checked checkbox

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31074 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5OOo/tests/testFormPrintout.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/product/ERP5OOo/tests/testFormPrintout.py b/product/ERP5OOo/tests/testFormPrintout.py
index 69fd62f938..31ef5c425c 100644
--- a/product/ERP5OOo/tests/testFormPrintout.py
+++ b/product/ERP5OOo/tests/testFormPrintout.py
@@ -1202,8 +1202,8 @@ return []
     if foo_form._getOb(field_name, None) is None:
       foo_form.manage_addField(field_name, 'CheckBox', 'CheckBoxField')
     checkbox = getattr(foo_form, field_name)
-    checkbox.values['default'] = 1
 
+    checkbox.values['default'] = 1
     odf_document = foo_printout()
     builder = OOoBuilder(odf_document)
     content_xml = builder.extract("content.xml")
@@ -1211,6 +1211,13 @@ return []
     node = document_tree.xpath('//form:checkbox[@form:name = "%s"]' % field_name, namespaces=document_tree.nsmap)[0]
     self.assertTrue(node.get('{%s}current-state' % document_tree.nsmap['form']))
 
+    checkbox.values['default'] = 0
+    odf_document = foo_printout()
+    builder = OOoBuilder(odf_document)
+    content_xml = builder.extract("content.xml")
+    document_tree = etree.XML(content_xml)
+    node = document_tree.xpath('//form:checkbox[@form:name = "%s"]' % field_name, namespaces=document_tree.nsmap)[0]
+    self.assertFalse(node.get('{%s}current-state' % document_tree.nsmap['form']))
 
 def test_suite():
   suite = unittest.TestSuite()
-- 
2.30.9