Commit 60dc1d2a authored by Jérome Perrin's avatar Jérome Perrin

tests that _aq_reset is called when the system configuration changes and this

requires regenerating dynamic methods.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17043 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 81368b17
...@@ -1669,6 +1669,32 @@ class TestPropertySheet: ...@@ -1669,6 +1669,32 @@ class TestPropertySheet:
checked_permission=checked_permission) checked_permission=checked_permission)
self.assertSameSet([beta_path, gamma_path], foo.getRegionList()) self.assertSameSet([beta_path, gamma_path], foo.getRegionList())
# _aq_reset should be called implicitly when the system configuration
# changes:
def test_aq_reset_on_portal_types_properties_change(self):
doc = self.portal.person_module.newContent(portal_type='Person')
ti = self.getTypesTool()['Person']
self.assertFalse(hasattr(doc, 'getDestination'))
ti.manage_editProperties(dict(base_category_list=
list(ti.base_category_list) + ['destination']))
self.assertTrue(hasattr(doc, 'getDestination'))
def test_aq_reset_on_workflow_chain_change(self):
doc = self.portal.person_module.newContent(portal_type='Person')
ti = self.getTypesTool()['Person']
self.assertFalse(hasattr(doc, 'getCausalityState'))
# chain the portal type with a workflow that has 'causality_state' as
# state variable name, this should regenerate the getCausalityState
# accessor. This test might have to be updated whenever
# delivery_causality_workflow changes.
self.portal.portal_workflow.manage_changeWorkflows(
default_chain='',
props=dict(chain_Person='delivery_causality_workflow'))
self.assertTrue(hasattr(doc, 'getCausalityState'))
# ... other cases should be added here
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestERP5Type)) suite.addTest(unittest.makeSuite(TestERP5Type))
......
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