Changeset 8166 for main/waeup.kofa/trunk/src/waeup/kofa/schema/tests
- Timestamp:
- 15 Apr 2012, 17:51:13 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/schema/tests/test_fields.py
r8158 r8166 3 3 import unittest 4 4 from zope.interface.verify import verifyClass, verifyObject 5 from zope.schema.interfaces import IDate , IDatetime6 from waeup.kofa.schema import FormattedDate , FormattedDatetime7 from waeup.kofa.schema.interfaces import IFormattedDate , IFormattedDatetime5 from zope.schema.interfaces import IDate 6 from waeup.kofa.schema import FormattedDate 7 from waeup.kofa.schema.interfaces import IFormattedDate 8 8 9 9 class FormattedDateTests(unittest.TestCase): … … 32 32 self.assertEqual(obj.date_format, '%d.%m.%Y') 33 33 return 34 35 class FormattedDatetimeTests(unittest.TestCase):36 # Tests for FormattedDatetime field.37 38 def test_iface(self):39 # make sure we fullfill interface contracts40 obj = FormattedDatetime()41 verifyClass(IDatetime, FormattedDatetime)42 verifyClass(IFormattedDatetime, FormattedDatetime)43 verifyObject(IDatetime, obj)44 verifyObject(IFormattedDatetime, obj)45 return46 47 def test_defaults(self):48 # we get expected default values for datetimes.49 obj = FormattedDatetime()50 self.assertEqual(obj.show_time, True)51 self.assertEqual(obj.date_format, None)52 return53 54 def test_attribs(self):55 # we can set the promised attributes.56 obj = FormattedDatetime(show_time=False,57 date_format='%d.%m.%Y %H:%M:%S Uhr')58 self.assertEqual(obj.show_time, False)59 self.assertEqual(obj.date_format, '%d.%m.%Y %H:%M:%S Uhr')60 return
Note: See TracChangeset for help on using the changeset viewer.