Commit 4551109a authored by Jean-Paul Smets's avatar Jean-Paul Smets

Fixed testPreferences test.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17643 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 538b8573
...@@ -128,6 +128,8 @@ class PreferenceMethod(Method): ...@@ -128,6 +128,8 @@ class PreferenceMethod(Method):
value = None value = None
for pref in instance._getSortedPreferenceList(*args, **kw): for pref in instance._getSortedPreferenceList(*args, **kw):
value = getattr(pref, self._preference_name, _marker) value = getattr(pref, self._preference_name, _marker)
# XXX-JPS Why don't we use accessors here such as:
# value = pref.getProperty(self._preference_name, _marker)
if value is not _marker: if value is not _marker:
# If callable, store the return value. # If callable, store the return value.
if callable(value): if callable(value):
......
...@@ -386,7 +386,8 @@ class TestPreferences(ERP5TypeTestCase): ...@@ -386,7 +386,8 @@ class TestPreferences(ERP5TypeTestCase):
state_list = method() state_list = method()
self.assertEquals(state_list, None) self.assertEquals(state_list, None)
state_list = method(('default',)) state_list = method(('default',))
self.assertEquals(state_list, ('default',)) self.assertEquals(state_list, ['default',]) # getPreferredAccountingTransactionSimulationStateList
# always tries to cast tuples to lists
method = lambda *args: pref_tool.getPreference('preferred_accounting_transaction_simulation_state_list', *args) method = lambda *args: pref_tool.getPreference('preferred_accounting_transaction_simulation_state_list', *args)
state_list = method() state_list = method()
......
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