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): ...@@ -145,31 +145,40 @@ class TestPreferences(ERP5TypeTestCase):
self.assertEquals(group.getPreferenceState(), 'enabled') self.assertEquals(group.getPreferenceState(), 'enabled')
self.assertEquals(site.getPreferenceState(), 'enabled') self.assertEquals(site.getPreferenceState(), 'enabled')
person1.setPreferredAccountingTransactionSimulationState([]) person1.setPreferredAccountingTransactionSimulationState([])
self.assertEquals(person1.getPreferredAccountingTransactionSimulationState(), None)
group.setPreferredAccountingTransactionSimulationState([]) group.setPreferredAccountingTransactionSimulationState([])
self.assertEquals(group.getPreferredAccountingTransactionSimulationState(), None)
site.setPreferredAccountingTransactionSimulationState([]) site.setPreferredAccountingTransactionSimulationState([])
self.assertEquals(site.getPreferredAccountingTransactionSimulationState(), None)
from Products.ERP5Type.Cache import clearCache
clearCache()
self.assertEquals(len(pref_tool.getPreference( self.assertEquals(len(pref_tool.getPreference(
'preferred_accounting_transaction_simulation_state')), 0) 'preferred_accounting_transaction_simulation_state')), 0)
site.setPreferredAccountingTransactionSimulationStateList( site.setPreferredAccountingTransactionSimulationStateList(
['stopped', 'delivered']) ['stopped', 'delivered'])
clearCache()
self.assertEquals(list(pref_tool.getPreference( self.assertEquals(list(pref_tool.getPreference(
'preferred_accounting_transaction_simulation_state')), 'preferred_accounting_transaction_simulation_state')),
list(site.getPreferredAccountingTransactionSimulationStateList())) list(site.getPreferredAccountingTransactionSimulationStateList()))
group.setPreferredAccountingTransactionSimulationStateList(['draft']) group.setPreferredAccountingTransactionSimulationStateList(['draft'])
clearCache()
self.assertEquals(list(pref_tool.getPreference( self.assertEquals(list(pref_tool.getPreference(
'preferred_accounting_transaction_simulation_state')), 'preferred_accounting_transaction_simulation_state')),
list(group.getPreferredAccountingTransactionSimulationStateList())) list(group.getPreferredAccountingTransactionSimulationStateList()))
person1.setPreferredAccountingTransactionSimulationStateList( person1.setPreferredAccountingTransactionSimulationStateList(
['cancelled']) ['cancelled'])
clearCache()
self.assertEquals(list(pref_tool.getPreference( self.assertEquals(list(pref_tool.getPreference(
'preferred_accounting_transaction_simulation_state')), 'preferred_accounting_transaction_simulation_state')),
list(person1.getPreferredAccountingTransactionSimulationStateList())) list(person1.getPreferredAccountingTransactionSimulationStateList()))
# disable person -> group is selected # disable person -> group is selected
self.getWorkflowTool().doActionFor(person1, self.getWorkflowTool().doActionFor(person1,
'disable_action', wf_id='preference_workflow') 'disable_action', wf_id='preference_workflow')
clearCache()
self.assertEquals(list(pref_tool.getPreference( self.assertEquals(list(pref_tool.getPreference(
'preferred_accounting_transaction_simulation_state')), 'preferred_accounting_transaction_simulation_state')),
list(group.getPreferredAccountingTransactionSimulationStateList())) 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