Commit 24b36f8a authored by Julien Muchembled's avatar Julien Muchembled

tests: remove a few self.commit()

parent 6eeaf981
...@@ -292,7 +292,7 @@ class TestInventory(InventoryAPITestCase): ...@@ -292,7 +292,7 @@ class TestInventory(InventoryAPITestCase):
sim_mvt.setDeliveryValue(mvt) sim_mvt.setDeliveryValue(mvt)
self.failIf(sim_mvt.isAccountable()) self.failIf(sim_mvt.isAccountable())
# not accountable movement are not counted by getInventory # not accountable movement are not counted by getInventory
self.commit(); self.tic() # (after reindexing of course) self.tic() # (after reindexing of course)
self.assertInventoryEquals(100, section_uid=self.section.getUid()) self.assertInventoryEquals(100, section_uid=self.section.getUid())
def test_OmitSimulation(self): def test_OmitSimulation(self):
......
...@@ -298,7 +298,7 @@ class TestPreferences(PropertySheetTestCase): ...@@ -298,7 +298,7 @@ class TestPreferences(PropertySheetTestCase):
id='user_a_1', portal_type='Preference') id='user_a_1', portal_type='Preference')
user_a_2 = portal_preferences.newContent( user_a_2 = portal_preferences.newContent(
id='user_a_2', portal_type='Preference') id='user_a_2', portal_type='Preference')
self.commit(); self.tic() self.tic()
# enable a pref # enable a pref
portal_workflow.doActionFor( portal_workflow.doActionFor(
...@@ -312,7 +312,7 @@ class TestPreferences(PropertySheetTestCase): ...@@ -312,7 +312,7 @@ class TestPreferences(PropertySheetTestCase):
user_b_1 = portal_preferences.newContent( user_b_1 = portal_preferences.newContent(
id='user_b_1', portal_type='Preference') id='user_b_1', portal_type='Preference')
user_b_1.setPreferredAccountingTransactionAtDate(DateTime(2002, 02, 02)) user_b_1.setPreferredAccountingTransactionAtDate(DateTime(2002, 02, 02))
self.commit(); self.tic() self.tic()
# enable this preference # enable this preference
portal_workflow.doActionFor( portal_workflow.doActionFor(
...@@ -335,12 +335,12 @@ class TestPreferences(PropertySheetTestCase): ...@@ -335,12 +335,12 @@ class TestPreferences(PropertySheetTestCase):
id='manager_pref', portal_type='Preference') id='manager_pref', portal_type='Preference')
manager_pref.setPreferredAccountingTransactionAtDate( manager_pref.setPreferredAccountingTransactionAtDate(
DateTime(2012, 12, 12)) DateTime(2012, 12, 12))
self.commit(); self.tic() self.tic()
# enable this preference # enable this preference
portal_workflow.doActionFor( portal_workflow.doActionFor(
manager_pref, 'enable_action', wf_id='preference_workflow') manager_pref, 'enable_action', wf_id='preference_workflow')
self.assertEquals(manager_pref.getPreferenceState(), 'enabled') self.assertEquals(manager_pref.getPreferenceState(), 'enabled')
self.commit(); self.tic() self.tic()
# check users preferences are still enabled # check users preferences are still enabled
self.assertEquals(user_a_1.getPreferenceState(), 'enabled') self.assertEquals(user_a_1.getPreferenceState(), 'enabled')
...@@ -374,7 +374,7 @@ class TestPreferences(PropertySheetTestCase): ...@@ -374,7 +374,7 @@ class TestPreferences(PropertySheetTestCase):
# picked first # picked first
priority=Priority.GROUP, priority=Priority.GROUP,
preferred_accounting_transaction_simulation_state_list=['user_a']) preferred_accounting_transaction_simulation_state_list=['user_a'])
self.commit(); self.tic() self.tic()
# enable a pref # enable a pref
portal_workflow.doActionFor( portal_workflow.doActionFor(
...@@ -385,7 +385,7 @@ class TestPreferences(PropertySheetTestCase): ...@@ -385,7 +385,7 @@ class TestPreferences(PropertySheetTestCase):
user_b = portal_preferences.newContent( user_b = portal_preferences.newContent(
id='user_b', portal_type='Preference', id='user_b', portal_type='Preference',
preferred_accounting_transaction_simulation_state_list=['user_b']) preferred_accounting_transaction_simulation_state_list=['user_b'])
self.commit(); self.tic() self.tic()
# enable this preference # enable this preference
portal_workflow.doActionFor( portal_workflow.doActionFor(
......
...@@ -1680,7 +1680,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -1680,7 +1680,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
person.manage_permission('View', roles=['Auditor'], acquire=0) person.manage_permission('View', roles=['Auditor'], acquire=0)
# The user may not view the person object. # The user may not view the person object.
self.commit(); self.tic() self.tic()
self.assertTrue('Auditor' not in user.getRolesInContext(person)) self.assertTrue('Auditor' not in user.getRolesInContext(person))
self.logout() self.logout()
newSecurityManager(None, user) newSecurityManager(None, user)
...@@ -1695,7 +1695,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -1695,7 +1695,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
# reflect the security change, until the affected objects are # reflect the security change, until the affected objects are
# reindexed, and Jean-Paul believes that this should not be # reindexed, and Jean-Paul believes that this should not be
# automatic. # automatic.
self.commit(); self.tic() self.tic()
self.assertTrue('Auditor' in user.getRolesInContext(person)) self.assertTrue('Auditor' in user.getRolesInContext(person))
self.logout() self.logout()
newSecurityManager(None, user) newSecurityManager(None, user)
...@@ -1706,7 +1706,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -1706,7 +1706,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
# Now invoke the reindexing explicitly, so the catalog should be # Now invoke the reindexing explicitly, so the catalog should be
# synchronized. # synchronized.
person_module.recursiveReindexObject() person_module.recursiveReindexObject()
self.commit(); self.tic() self.tic()
self.assertTrue('Auditor' in user.getRolesInContext(person)) self.assertTrue('Auditor' in user.getRolesInContext(person))
self.logout() self.logout()
newSecurityManager(None, user) newSecurityManager(None, 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