Commit 7dbdb63d authored by Łukasz Nowak's avatar Łukasz Nowak

- check negative case for getActiveSystemPreference - nothing is returned in normal operation


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28292 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5af48b05
...@@ -110,12 +110,16 @@ class TestPreferences(ERP5TypeTestCase): ...@@ -110,12 +110,16 @@ class TestPreferences(ERP5TypeTestCase):
site = self.getPreferenceTool()['site'] site = self.getPreferenceTool()['site']
self.assertEqual(None, self.getPreferenceTool().getActivePreference()) self.assertEqual(None, self.getPreferenceTool().getActivePreference())
self.assertEqual(None,
self.getPreferenceTool().getActiveSystemPreference())
person1.portal_workflow.doActionFor( person1.portal_workflow.doActionFor(
person1, 'enable_action', wf_id='preference_workflow') person1, 'enable_action', wf_id='preference_workflow')
self.assertEquals(person1.getPreferenceState(), 'enabled') self.assertEquals(person1.getPreferenceState(), 'enabled')
self.assertEqual( person1, self.getPreferenceTool().getActivePreference()) self.assertEqual( person1, self.getPreferenceTool().getActivePreference())
self.assertEqual(None,
self.getPreferenceTool().getActiveSystemPreference())
portal_workflow.doActionFor( portal_workflow.doActionFor(
site, 'enable_action', wf_id='preference_workflow') site, 'enable_action', wf_id='preference_workflow')
...@@ -123,6 +127,8 @@ class TestPreferences(ERP5TypeTestCase): ...@@ -123,6 +127,8 @@ class TestPreferences(ERP5TypeTestCase):
self.assertEquals(site.getPreferenceState(), 'global') self.assertEquals(site.getPreferenceState(), 'global')
self.assertEqual(person1, self.getPreferenceTool().getActivePreference()) self.assertEqual(person1, self.getPreferenceTool().getActivePreference())
self.assertEqual(None,
self.getPreferenceTool().getActiveSystemPreference())
portal_workflow.doActionFor( portal_workflow.doActionFor(
group, 'enable_action', wf_id='preference_workflow') group, 'enable_action', wf_id='preference_workflow')
...@@ -131,10 +137,14 @@ class TestPreferences(ERP5TypeTestCase): ...@@ -131,10 +137,14 @@ class TestPreferences(ERP5TypeTestCase):
self.assertEquals(site.getPreferenceState(), 'global') self.assertEquals(site.getPreferenceState(), 'global')
self.assertEqual(person1, self.getPreferenceTool().getActivePreference()) self.assertEqual(person1, self.getPreferenceTool().getActivePreference())
self.assertEqual(None,
self.getPreferenceTool().getActiveSystemPreference())
portal_workflow.doActionFor( portal_workflow.doActionFor(
person2, 'enable_action', wf_id='preference_workflow') person2, 'enable_action', wf_id='preference_workflow')
self.assertEqual(person2, self.getPreferenceTool().getActivePreference()) self.assertEqual(person2, self.getPreferenceTool().getActivePreference())
self.assertEqual(None,
self.getPreferenceTool().getActiveSystemPreference())
self.assertEquals(person2.getPreferenceState(), 'enabled') self.assertEquals(person2.getPreferenceState(), 'enabled')
# enabling a preference disable all other of the same level # enabling a preference disable all other of the same level
self.assertEquals(person1.getPreferenceState(), 'disabled') self.assertEquals(person1.getPreferenceState(), 'disabled')
......
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