[test] Update test to follow changes in the seda cube
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 27 Apr 2017 15:25:49 +0200
changeset 3284 7d439b32ecfb
parent 3283 4e0c6cd1ebe5
child 3285 acba069ac98e
[test] Update test to follow changes in the seda cube 9016f1f0fe60 forbid managers to edit entities within a profile once it's published. Reorder the test case to test the `use_profile` relation last, since it requires profiles to be published.
test/unittest_hooks.py
--- a/test/unittest_hooks.py	Thu Apr 27 14:11:10 2017 +0200
+++ b/test/unittest_hooks.py	Thu Apr 27 15:25:49 2017 +0200
@@ -94,7 +94,6 @@
             transfer = testutils.setup_profile(cnx)
             unit, unit_alt, unit_alt_seq = testutils.create_archive_unit(transfer)
             cnx.commit()
-            transfer.cw_adapt_to('IWorkflowable').fire_transition('publish')
             transfer.cw_set(modification_date=YESTERDAY)
             cnx.commit()
 
@@ -103,14 +102,6 @@
             cnx.commit()
             self.assertMDNow(transfer)
             self.resetMD(cnx, transfer)
-            # edit link from root to an entity which is not part of the container
-            # XXX that shouldn't change anything for this special relation
-            agent = testutils.organization_unit(
-                cnx, u'marcel', archival_roles=['deposit'])
-            transfer.cw_set(reverse_use_profile=agent)
-            cnx.commit()
-            self.assertMDNow(transfer)
-            self.resetMD(cnx, transfer)
             # edit relation to a composite children
             code = scheme.reverse_in_scheme[0]
             rule_seq = cnx.create_entity('SEDASeqAccessRuleRule',
@@ -131,6 +122,16 @@
             rule.cw_delete()
             cnx.commit()
             self.assertMDNow(transfer)
+            transfer.cw_adapt_to('IWorkflowable').fire_transition('publish')
+            cnx.commit()
+            self.resetMD(cnx, transfer)
+            # edit link from root to an entity which is not part of the container
+            # XXX that shouldn't change anything for this special relation
+            agent = testutils.organization_unit(
+                cnx, u'marcel', archival_roles=['deposit'])
+            transfer.cw_set(reverse_use_profile=agent)
+            cnx.commit()
+            self.assertMDNow(transfer)
             self.resetMD(cnx, transfer)
 
     def test_externaluri_to_concept(self):