Commit d5ead34f authored by Romain Courteaud's avatar Romain Courteaud

Check that category accessors are OK with asContext object.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15287 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 97f5274e
...@@ -1096,6 +1096,19 @@ class TestPropertySheet: ...@@ -1096,6 +1096,19 @@ class TestPropertySheet:
self.assertEquals(self.getPersonModule(), obj.getParentValue()) self.assertEquals(self.getPersonModule(), obj.getParentValue())
self.assertEquals(self.getPersonModule(), copy.getParentValue()) self.assertEquals(self.getPersonModule(), copy.getParentValue())
# Test category accessor
gender = self.getCategoryTool().gender.newContent(
portal_type='Category', id='male')
# Category can not be used as asContext parameter
# new_copy = obj.asContext(gender=gender.getCategoryRelativeUrl())
# self.assertEquals(gender.getCategoryRelativeUrl(), new_copy.getGender())
new_copy = obj.asContext()
new_copy.edit(gender=gender.getCategoryRelativeUrl())
get_transaction().commit()
self.tic()
self.assertEquals(gender.getCategoryRelativeUrl(), new_copy.getGender())
self.assertEquals(None, obj.getGender())
def test_21_ActionCondition(self, quiet=quiet, run=run_all_test): def test_21_ActionCondition(self, quiet=quiet, run=run_all_test):
"""Tests action conditions """Tests action conditions
""" """
......
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