Commit 9e32260a authored by Yoshinori Okuji's avatar Yoshinori Okuji

It is ncessary to invalidate the cache.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4442 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0cfe3fef
......@@ -145,31 +145,40 @@ class TestPreferences(ERP5TypeTestCase):
self.assertEquals(group.getPreferenceState(), 'enabled')
self.assertEquals(site.getPreferenceState(), 'enabled')
person1.setPreferredAccountingTransactionSimulationState([])
self.assertEquals(person1.getPreferredAccountingTransactionSimulationState(), None)
group.setPreferredAccountingTransactionSimulationState([])
self.assertEquals(group.getPreferredAccountingTransactionSimulationState(), None)
site.setPreferredAccountingTransactionSimulationState([])
self.assertEquals(site.getPreferredAccountingTransactionSimulationState(), None)
from Products.ERP5Type.Cache import clearCache
clearCache()
self.assertEquals(len(pref_tool.getPreference(
'preferred_accounting_transaction_simulation_state')), 0)
site.setPreferredAccountingTransactionSimulationStateList(
['stopped', 'delivered'])
clearCache()
self.assertEquals(list(pref_tool.getPreference(
'preferred_accounting_transaction_simulation_state')),
list(site.getPreferredAccountingTransactionSimulationStateList()))
group.setPreferredAccountingTransactionSimulationStateList(['draft'])
clearCache()
self.assertEquals(list(pref_tool.getPreference(
'preferred_accounting_transaction_simulation_state')),
list(group.getPreferredAccountingTransactionSimulationStateList()))
person1.setPreferredAccountingTransactionSimulationStateList(
['cancelled'])
clearCache()
self.assertEquals(list(pref_tool.getPreference(
'preferred_accounting_transaction_simulation_state')),
list(person1.getPreferredAccountingTransactionSimulationStateList()))
# disable person -> group is selected
self.getWorkflowTool().doActionFor(person1,
'disable_action', wf_id='preference_workflow')
clearCache()
self.assertEquals(list(pref_tool.getPreference(
'preferred_accounting_transaction_simulation_state')),
list(group.getPreferredAccountingTransactionSimulationStateList()))
......
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