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

Guillaume Vandevelde guillaume.vandevelde at logilab.fr
Thu Sep 5 12:04:11 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 2ae077dee0aea7e22f13ba19b93df6b9377cb19e
# Parent  03d39fd65b161d05d89a4cc154f44d0e3e11cc16
# Available At http://hg.logilab.org/review/cubes/eac
#              hg pull http://hg.logilab.org/review/cubes/eac -r 2ae077dee0ae
Change uniqueness of the isni attribute on AuthorityRecord

diff -r 03d39fd65b16 -r 2ae077dee0ae 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
@@ -60,4 +60,4 @@
 add_relation_definition('EACResourceRelation', 'resource_relation_resource',
                         'AuthorityRecord')
 
-sync_schema_props_perms('record_id')
+sync_schema_props_perms('AuthorityRecord')
diff -r 03d39fd65b16 -r 2ae077dee0ae 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 03d39fd65b16 -r 2ae077dee0ae 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