Commit a4c7c670 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

disable existing User preferences before tests that create a new User preference.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25537 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 36d1102e
...@@ -3598,7 +3598,14 @@ class TestAccountingTransactionTemplate(AccountingTestCase): ...@@ -3598,7 +3598,14 @@ class TestAccountingTransactionTemplate(AccountingTestCase):
def getTitle(self): def getTitle(self):
return "Accounting Transaction Template" return "Accounting Transaction Template"
def disableUserPreferenceList(self):
"""Disable existing User preferences."""
for preference in self.portal.portal_preferences.objectValues():
if preference.getPriority() == Priority.USER:
preference.disable()
def test_Template(self): def test_Template(self):
self.disableUserPreferenceList()
self.login('claudie') self.login('claudie')
preference = self.portal.portal_preferences.newContent('Preference') preference = self.portal.portal_preferences.newContent('Preference')
preference.priority = Priority.USER preference.priority = Priority.USER
...@@ -3643,6 +3650,7 @@ class TestAccountingTransactionTemplate(AccountingTestCase): ...@@ -3643,6 +3650,7 @@ class TestAccountingTransactionTemplate(AccountingTestCase):
def test_Base_doAction(self): def test_Base_doAction(self):
# test creating a template using Base_doAction script (this is what # test creating a template using Base_doAction script (this is what
# erp5_xhtml_style does) # erp5_xhtml_style does)
self.disableUserPreferenceList()
self.login('claudie') self.login('claudie')
preference = self.portal.portal_preferences.newContent('Preference') preference = self.portal.portal_preferences.newContent('Preference')
preference.priority = Priority.USER preference.priority = Priority.USER
......
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