Commit fdb481a8 authored by Nicolas Delaby's avatar Nicolas Delaby

Test PropertyManager with date type values

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24955 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3f4b3741
...@@ -1059,6 +1059,22 @@ class TestERP5PropertyManager(unittest.TestCase): ...@@ -1059,6 +1059,22 @@ class TestERP5PropertyManager(unittest.TestCase):
ob._setProperty('a_dummy_property', dummy_property_value, type='tales') ob._setProperty('a_dummy_property', dummy_property_value, type='tales')
self.assertEquals(ob.getProperty('a_dummy_property'), 1+2) self.assertEquals(ob.getProperty('a_dummy_property'), 1+2)
def test_setPropertyTypeDate(self):
"""You can specify the type of the property in _setProperty"""
ob = self._makeOne('ob')
from DateTime import DateTime
dummy_property_value = DateTime()
ob._setProperty('a_dummy_property', dummy_property_value, type='date')
self.assertEquals(['date'], [x['type'] for x in ob.propertyMap()
if x['id'] == 'a_dummy_property'])
self.assertEquals(type(ob.getProperty('a_dummy_property')), type(DateTime()))
#Set Property without type argument
ob._setProperty('a_second_dummy_property', dummy_property_value)
self.assertEquals(['date'], [x['type'] for x in ob.propertyMap()
if x['id'] == 'a_second_dummy_property'])
self.assertEquals(type(ob.getProperty('a_second_dummy_property')),
type(DateTime()))
def test_getPropertyNonExistantProps(self): def test_getPropertyNonExistantProps(self):
"""getProperty return None if the value is not found. """getProperty return None if the value is not found.
""" """
......
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