[Erp5-report] r40518 nicolas - /erp5/trunk/products/ERP5Form/tests/testFields.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Nov 23 11:11:16 CET 2010
Author: nicolas
Date: Tue Nov 23 11:11:15 2010
New Revision: 40518
URL: http://svn.erp5.org?rev=40518&view=rev
Log:
test render_odt for IntegerField
Modified:
erp5/trunk/products/ERP5Form/tests/testFields.py
Modified: erp5/trunk/products/ERP5Form/tests/testFields.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/tests/testFields.py?rev=40518&r1=40517&r2=40518&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/tests/testFields.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/tests/testFields.py [utf8] Tue Nov 23 11:11:15 2010
@@ -41,7 +41,7 @@ from Products.Formulator.FieldRegistry i
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))
More information about the Erp5-report
mailing list