[PATCH saem_ref] Add a test demonstrating that ARK identifiers are not unique overall

Philippe Pepiot philippe.pepiot at logilab.fr
Fri Feb 16 12:25:25 CET 2018


On 16/02/2018, Denis Laxalde wrote:
> # HG changeset patch
> # User Denis Laxalde <denis.laxalde at logilab.fr>
> # Date 1518510957 -3600
> #      Tue Feb 13 09:35:57 2018 +0100
> # Node ID 21290968da9b5193e268a0e5901e183298679d4a
> # Parent  4a200f4623e28e2729c07d23cf62772d852ca007
> # Available At http://hg.logilab.org/review/cubes/saem_ref
> #              hg pull http://hg.logilab.org/review/cubes/saem_ref -r 21290968da9b
> # EXP-Topic ark/unique-overall
> Add a test demonstrating that ARK identifiers are not unique overall
> 
> diff --git a/test/unittest_schema.py b/test/unittest_schema.py
> --- a/test/unittest_schema.py
> +++ b/test/unittest_schema.py
> @@ -48,6 +48,14 @@ class SchemaConstraintsTC(CubicWebTC):
>      configcls = PostgresApptestConfiguration
>      assertValidationError = testutils.assertValidationError
>  
> +    def test_ark_unique_overall(self):
> +        # Demonstrate that we can create two entities with the same ARK
> +        # identifier, this is a bug.
> +        with self.admin_access.repo_cnx() as cnx:
> +            agent = testutils.agent(cnx, u'bob')
> +            testutils.setup_scheme(cnx, u'test', ark=agent.ark)
> +            cnx.commit()
> +

While reading, it's not clear that agent and scheme have the same ark
(since we don't know what method helpers are doing with the ark).

Maybe add an assertion after commit() ?

>      def test_published_constraint_on_contact_point(self):
>          """ create two agents: one published P and one not published N.
>              create one OU and check that interface will only show P that can become its
> 



More information about the saem-devel mailing list