Commit 698b2580 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_*:Replace recursiveImmediateReindexObject by self.commit() on tests

parent 61b5a31b
......@@ -93,7 +93,7 @@ class TestSlapOSComputerSecurity(TestSlapOSSecurityMixin):
computer.newContent(portal_type='ERP5 Login',
reference=reference).validate()
computer.recursiveImmediateReindexObject()
self.commit()
self._assertUserExists(user_id, reference, None)
......@@ -112,7 +112,7 @@ class TestSlapOSComputerSecurity(TestSlapOSSecurityMixin):
computer.setUserId(user_id)
computer.newContent(portal_type='ERP5 Login',
reference=reference)
computer.recursiveImmediateReindexObject()
self.commit()
self._assertUserDoesNotExists(user_id, reference, None)
......@@ -128,7 +128,7 @@ class TestSlapOSSoftwareInstanceSecurity(TestSlapOSSecurityMixin):
instance.validate()
instance.newContent(portal_type='ERP5 Login',
reference=reference).validate()
instance.recursiveImmediateReindexObject()
self.commit()
self._assertUserExists(user_id, reference, None)
......@@ -147,8 +147,7 @@ class TestSlapOSSoftwareInstanceSecurity(TestSlapOSSecurityMixin):
reference=subscription_reference)
subscription.validate()
instance.setSpecialise(subscription.getRelativeUrl())
subscription.recursiveImmediateReindexObject()
instance.recursiveImmediateReindexObject()
self.commit()
# clear cache in order to reset calculation
self.portal.portal_caches.clearAllCache()
......@@ -165,7 +164,7 @@ class TestSlapOSSoftwareInstanceSecurity(TestSlapOSSecurityMixin):
instance = self.portal.getDefaultModule(portal_type=self.portal_type)\
.newContent(portal_type=self.portal_type, reference=reference)
instance.setUserId(user_id)
instance.recursiveImmediateReindexObject()
self.commit()
self._assertUserDoesNotExists(user_id, reference, None)
......@@ -185,7 +184,6 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
reference=reference, password=password).validate()
self.commit()
person.recursiveImmediateReindexObject()
self._assertUserExists(user_id, reference, password)
......@@ -199,7 +197,6 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
self.login()
person.newContent(portal_type='Assignment', group='company').open()
self.commit()
person.recursiveImmediateReindexObject()
self.tic()
self.portal.portal_caches.clearAllCache()
......@@ -211,7 +208,7 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
# add to role category
self.login()
person.newContent(portal_type='Assignment', role='member').open()
person.recursiveImmediateReindexObject()
self.commit()
self.portal.portal_caches.clearAllCache()
self.login(person.getUserId())
......@@ -228,7 +225,6 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
reference=reference, password=password)
self.commit()
person.recursiveImmediateReindexObject()
self._assertUserDoesNotExists(user_id, reference, password)
......
......@@ -46,7 +46,6 @@ class TestSlapOSShadowPerson(TestSlapOSSecurityMixin):
person.newContent(portal_type='ERP5 Login',
reference=reference, password=password).validate()
self.commit()
person.recursiveImmediateReindexObject()
self._assertUserExists(user_id, reference, password)
......@@ -70,7 +69,6 @@ class TestSlapOSShadowPerson(TestSlapOSSecurityMixin):
person.setUserId(user_id)
self.commit()
person.recursiveImmediateReindexObject()
self._assertUserDoesNotExists(user_id, reference, password)
self._assertUserDoesNotExists(shadow_user_id, reference, None)
......@@ -90,7 +88,7 @@ class TestSlapOSShadowComputer(TestSlapOSSecurityMixin):
reference=reference).validate()
computer.validate()
computer.recursiveImmediateReindexObject()
self.commit()
self._assertUserExists(user_id, reference, None)
self._assertUserExists(shadow_user_id, reference, None)
......@@ -111,7 +109,7 @@ class TestSlapOSShadowComputer(TestSlapOSSecurityMixin):
reference=reference)
computer.setUserId(user_id)
computer.recursiveImmediateReindexObject()
self.commit()
self._assertUserDoesNotExists(user_id, reference, None)
self._assertUserDoesNotExists(user_id, shadow_reference, None)
......@@ -130,7 +128,7 @@ class TestSlapOSShadowSoftwareInstance(TestSlapOSSecurityMixin):
instance.newContent(portal_type='ERP5 Login',
reference=reference).validate()
instance.validate()
instance.recursiveImmediateReindexObject()
self.commit()
self._assertUserExists(user_id, reference, None)
self._assertUserExists(shadow_user_id, reference, None)
......@@ -150,7 +148,7 @@ class TestSlapOSShadowSoftwareInstance(TestSlapOSSecurityMixin):
instance = self.portal.getDefaultModule(portal_type=self.portal_type)\
.newContent(portal_type=self.portal_type, reference=reference)
instance.setUserId(user_id)
instance.recursiveImmediateReindexObject()
self.commit()
self._assertUserDoesNotExists(user_id, reference, None)
self._assertUserDoesNotExists(user_id, shadow_reference, None)
......
......@@ -2085,8 +2085,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
person.newContent(portal_type='Assignment', role='member').open()
person.newContent(portal_type='ERP5 Login', reference=reference).validate()
transaction.commit()
person.recursiveImmediateReindexObject()
self.commit()
self.person = person
self.person_reference = person.getReference()
self.person_user_id = person.getUserId()
......@@ -2966,4 +2965,4 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
self.login(self.person_user_id)
response = self.portal_slap.getHateoasUrl()
self.assertEqual(200, response.status)
self.assertEqual('foo', response.body)
\ No newline at end of file
self.assertEqual('foo', response.body)
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