[PATCH 6 of 7 saem_ref] Insert valid "ark" attributes in all tests

Denis Laxalde denis.laxalde at logilab.fr
Wed Feb 21 12:03:31 CET 2018


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1519209758 -3600
#      Wed Feb 21 11:42:38 2018 +0100
# Node ID 4e2b908a791f0250f1bc26f460ecad8b5bb3574b
# Parent  ce883b461791559111b9bd0fe337d9dfc68aa9ad
# Available At http://hg.logilab.org/review/cubes/saem_ref
#              hg pull http://hg.logilab.org/review/cubes/saem_ref -r 4e2b908a791f
# EXP-Topic ark/unique-overall
Insert valid "ark" attributes in all tests

See previous changeset for why.

diff --git a/test/test_views.py b/test/test_views.py
--- a/test/test_views.py
+++ b/test/test_views.py
@@ -116,7 +116,7 @@ class FuncViewsTC(CubicWebTC):
         with self.admin_access.web_request() as req:
             req._ = lambda x: x + u' \xe9'
             authority = req.cnx.create_entity('Organization', name=u'dummy',
-                                              ark=u'123')
+                                              ark=u'123/dummy')
             req.user.cw_set(authority=authority)
             req.cnx.commit()
             output = self.view(regid, req=req, template=None)
@@ -475,7 +475,7 @@ class AssignArkWebServiceTC(CubicWebTC):
     def test_authenticated_organization_has_no_naa_method_post(self):
         with self.admin_access.cnx() as cnx:
             org_ark = cnx.create_entity(
-                'Organization', name=u'dummy', ark=u'123').ark
+                'Organization', name=u'dummy', ark=u'123/dummy').ark
             cnx.commit()
         bad_params = {'organization': org_ark}
         with self.admin_access.web_request(
diff --git a/test/unittest_hooks.py b/test/unittest_hooks.py
--- a/test/unittest_hooks.py
+++ b/test/unittest_hooks.py
@@ -238,10 +238,10 @@ class ARKGenerationHooksTC(CubicWebTC):
             agent = testutils.authority_record(cnx, u'bob')
             cnx.commit()
             self._check_ark_and_cwuri(agent)
-            agent = testutils.authority_record(cnx, u'john', ark=u'authority/123456')
+            agent = testutils.authority_record(cnx, u'john', ark=u'999/123456')
             cnx.commit()
-            self.assertEqual(agent.ark, 'authority/123456')
-            self.assertEqual(agent.cwuri, 'ark:/authority/123456')
+            self.assertEqual(agent.ark, '999/123456')
+            self.assertEqual(agent.cwuri, 'ark:/999/123456')
             agent = testutils.authority_record(cnx, u'alf', cwuri=u'http://someuri/someagent')
             cnx.commit()
             self._check_ark(agent)
@@ -254,9 +254,9 @@ class ARKGenerationHooksTC(CubicWebTC):
 
     def test_ark_generation_seda_profile_ark_given(self):
         with self.admin_access.repo_cnx() as cnx:
-            profile = testutils.setup_profile(cnx, ark=u'authority/124')
-            self.assertEqual(profile.ark, 'authority/124')
-            self.assertEqual(profile.cwuri, 'ark:/authority/124')
+            profile = testutils.setup_profile(cnx, ark=u'99/124')
+            self.assertEqual(profile.ark, '99/124')
+            self.assertEqual(profile.cwuri, 'ark:/99/124')
 
     def test_ark_generation_seda_profile_with_cwuri(self):
         with self.admin_access.repo_cnx() as cnx:



More information about the saem-devel mailing list