From 37cad69cca79a992181cdeddb47f4ca4c1392817 Mon Sep 17 00:00:00 2001
From: Nicolas Delaby <nicolas@nexedi.com>
Date: Tue, 23 Nov 2010 10:11:15 +0000
Subject: [PATCH] test render_odt for IntegerField

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

diff --git a/product/ERP5Form/tests/testFields.py b/product/ERP5Form/tests/testFields.py
index 75799a92ba..d79ca39ad8 100644
--- a/product/ERP5Form/tests/testFields.py
+++ b/product/ERP5Form/tests/testFields.py
@@ -41,7 +41,7 @@ from Products.Formulator.FieldRegistry import FieldRegistry
 from Products.Formulator.Validator import ValidationError
 from Products.Formulator.StandardFields import FloatField, StringField,\
 DateTimeField, TextAreaField, CheckBoxField, ListField, LinesField, \
-MultiListField
+MultiListField, IntegerField
 from Products.Formulator.MethodField import Method, BoundMethod
 from Products.Formulator.TALESField import TALESMethod
 
@@ -230,6 +230,22 @@ class TestFloatField(ERP5TypeTestCase):
       .xpath('%s/text()' % ODG_XML_WRAPPING_XPATH, namespaces=NSMAP)[0]
     self.assertEquals('1 000.0', test_value)
 
+class TestIntegerField(ERP5TypeTestCase):
+  """Tests integer field
+  """
+
+  def getTitle(self):
+    return "Integer Field"
+
+  def afterSetUp(self):
+    self.field = IntegerField('test_field')
+    self.widget = self.field.widget
+
+  def test_render_odt(self):
+    self.field.values['default'] = 34
+    self.assertEquals('34', self.field.render_odt(as_string=False).text)
+
+
 class TestStringField(ERP5TypeTestCase):
   """Tests string field
   """
@@ -882,6 +898,7 @@ def test_suite():
   suite = unittest.TestSuite()
   suite.addTest(unittest.makeSuite(TestRenderViewAPI))
   suite.addTest(unittest.makeSuite(TestFloatField))
+  suite.addTest(unittest.makeSuite(TestIntegerField))
   suite.addTest(unittest.makeSuite(TestStringField))
   suite.addTest(unittest.makeSuite(TestDateTimeField))
   suite.addTest(unittest.makeSuite(TestTextAreaField))
-- 
2.30.9