Commit eb40621b authored by Nicolas Delaby's avatar Nicolas Delaby

Test ListField.widget.render_odt


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32860 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 998ebe43
...@@ -65,7 +65,7 @@ from Acquisition import aq_base ...@@ -65,7 +65,7 @@ from Acquisition import aq_base
from Products.Formulator.FieldRegistry import FieldRegistry from Products.Formulator.FieldRegistry import FieldRegistry
from Products.Formulator.Validator import ValidationError from Products.Formulator.Validator import ValidationError
from Products.Formulator.StandardFields import FloatField, StringField,\ from Products.Formulator.StandardFields import FloatField, StringField,\
DateTimeField, TextAreaField, CheckBoxField DateTimeField, TextAreaField, CheckBoxField, ListField
from Products.Formulator.MethodField import Method, BoundMethod from Products.Formulator.MethodField import Method, BoundMethod
from Products.Formulator.TALESField import TALESMethod from Products.Formulator.TALESField import TALESMethod
...@@ -334,6 +334,23 @@ class TestCheckBoxField(unittest.TestCase): ...@@ -334,6 +334,23 @@ class TestCheckBoxField(unittest.TestCase):
self.field.render_odt(as_string=False, REQUEST=request).tag) self.field.render_odt(as_string=False, REQUEST=request).tag)
self.assertEquals('1', self.field.render_odt(as_string=False, REQUEST=request).text) self.assertEquals('1', self.field.render_odt(as_string=False, REQUEST=request).text)
class TestListField(unittest.TestCase):
"""Tests List field
"""
def getTitle(self):
return "List Field"
def setUp(self):
self.field = ListField('test_field')
self.widget = self.field.widget
def test_render_odt(self):
self.field.values['default'] = ['My first Line', 'My Second Line', 'foo']
self.assertEquals('text:line-break',
self.field.render_odt(as_string=False)[0].xpath('name()'))
class TestProxyField(PlacelessSetup, unittest.TestCase): class TestProxyField(PlacelessSetup, unittest.TestCase):
def getTitle(self): def getTitle(self):
...@@ -738,6 +755,7 @@ def test_suite(): ...@@ -738,6 +755,7 @@ def test_suite():
suite.addTest(unittest.makeSuite(TestDateTimeField)) suite.addTest(unittest.makeSuite(TestDateTimeField))
suite.addTest(unittest.makeSuite(TestTextAreaField)) suite.addTest(unittest.makeSuite(TestTextAreaField))
suite.addTest(unittest.makeSuite(TestCheckBoxField)) suite.addTest(unittest.makeSuite(TestCheckBoxField))
suite.addTest(unittest.makeSuite(TestListField))
suite.addTest(unittest.makeSuite(TestProxyField)) suite.addTest(unittest.makeSuite(TestProxyField))
suite.addTest(unittest.makeSuite(TestFieldValueCache)) suite.addTest(unittest.makeSuite(TestFieldValueCache))
return suite return suite
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment