[PATCH saem_ref V2] [hooks] Fix crash on attempt to set an email to a user

Denis Laxalde denis.laxalde at logilab.fr
Fri Mar 10 15:09:18 CET 2017


Sylvain Thenault a écrit :
> # HG changeset patch
> # User Sylvain Thénault <sylvain.thenault at logilab.fr>
> # Date 1489006048 -3600
> #      Wed Mar 08 21:47:28 2017 +0100
> # Node ID a8a27140a4a4fd7b12c6b881e240b7fcbfb5b35a
> # Parent  3ca8d29161df269f143468ed1665495b4279618f
> [hooks] Fix crash on attempt to set an email to a user

> --- a/test/unittest_hooks.py
> +++ b/test/unittest_hooks.py
> @@ -247,10 +247,19 @@ class SAEMRefHooksTC(CubicWebTC):
>              self.assertEqual(scheme.ark, '67717/Matiere')
>              self.assertEqual(scheme.cwuri, 'http://dcf/res/ark:/67717/Matiere')
>              self.assertEqual(concept.ark, '67717/1234')
>              self.assertEqual(concept.cwuri, 'http://dcf/res/ark:/67717/1234')
>
> +    def test_user_email(self):
> +        # EmailAddress belong to the Organisation graph, hence may conflict with hooks when linked
> +        # to a user. This is a non-regression test checking that no error is raised on attempt to
> +        # add an email to a user (which is not adaptable to IContained nor IContainer)
> +        with self.admin_access.repo_cnx() as cnx:
> +            cnx.create_entity('EmailAddress', address=u'admin at cubicweb.org',
> +                              reverse_use_email=cnx.user.eid)
> +            cnx.commit()
> +
>

I still don't understand this... but applied.



More information about the saem-devel mailing list