[PATCH eac] Change uniqueness of the isni attribute on AuthorityRecord

Guillaume Vandevelde guillaume.vandevelde at logilab.fr
Thu Sep 5 11:21:54 CEST 2019


# HG changeset patch
# User Guillaume Vandevelde <gvandevelde at logilab.fr>
# Date 1567181671 -7200
#      Fri Aug 30 18:14:31 2019 +0200
# Node ID c125c88fb09df7a5bf70673a1bb603bf330773e0
# Parent  be2cf56106457b8bd6440330d5f72e867070435e
# Available At http://hg.logilab.org/review/cubes/eac
#              hg pull http://hg.logilab.org/review/cubes/eac -r c125c88fb09d
Change uniqueness of the isni attribute on AuthorityRecord

diff -r be2cf5610645 -r c125c88fb09d cubicweb_eac/migration/0.9.0_Any.py
--- a/cubicweb_eac/migration/0.9.0_Any.py	Thu Sep 05 11:18:02 2019 +0200
+++ b/cubicweb_eac/migration/0.9.0_Any.py	Fri Aug 30 18:14:31 2019 +0200
@@ -61,4 +61,7 @@
 add_relation_definition('EACResourceRelation', 'resource_relation_resource',
                         'AuthorityRecord')
 
-sync_schema_props_perms('record_id')
+add_relation_definition('EACFunctionRelation', 'function_relation_function',
+                        'AuthorityRecord')
+
+sync_schema_props_perms('AuthorityRecord')
diff -r be2cf5610645 -r c125c88fb09d cubicweb_eac/schema.py
--- a/cubicweb_eac/schema.py	Thu Sep 05 11:18:02 2019 +0200
+++ b/cubicweb_eac/schema.py	Fri Aug 30 18:14:31 2019 +0200
@@ -58,8 +58,7 @@
         '<=', Attribute('end_date'), msg=_('start date must be less than end date'))])
     end_date = Date()
     record_id = String(indexed=True, required=True, unique=True)
-    isni = String(unique=True,
-                  description=_('International Standard Name Identifier'))
+    isni = String(description=_('International Standard Name Identifier'))
     languages = String()
 
 
diff -r be2cf5610645 -r c125c88fb09d test/test_views.py
--- a/test/test_views.py	Thu Sep 05 11:18:02 2019 +0200
+++ b/test/test_views.py	Fri Aug 30 18:14:31 2019 +0200
@@ -58,10 +58,10 @@
             req.form = self.fake_form(regid, fields)
             # now actually test the import
             html = req.view(regid)
-            self.assertIn('EAC import failed', html)
+            self.assertNotIn('EAC import failed', html)
             # Still only one AuthorityRecord.
             rset = req.find('AuthorityRecord')
-            self.assertEqual(len(rset), 1)
+            self.assertEqual(len(rset), 2)
 
     def test_import_invalid_xml(self):
         regid = 'eac.import'



More information about the saem-devel mailing list