[PATCH 2 of 2 saem] [test/security] More complete test case about profile permissions

Sylvain Thénault sylvain.thenault at logilab.fr
Thu Apr 27 16:08:09 CEST 2017


CI fail for various reasons. Will rebase these csets and add a new one
that fix failure with latest seda cset (in review) in a V2

New CI run: https://jenkins.logilab.org/job/cubicweb-saem_ref/237/


Le 27/04/2017 à 14:31, Sylvain Thenault a écrit :
> # HG changeset patch
> # User Sylvain Thénault <sylvain.thenault at logilab.fr>
> # Date 1493295070 -7200
> #      Thu Apr 27 14:11:10 2017 +0200
> # Node ID ede6fccde0fdf619ad035289e869920950fcb826
> # Parent  a0a8141c4e18bf8344226d211b4402a75a427023
> # Available At http://hg.logilab.org/review/cubes/saem_ref
> #              hg pull http://hg.logilab.org/review/cubes/saem_ref -r ede6fccde0fd
> [test/security] More complete test case about profile permissions
>
> This is also indirectly tested in the seda cube, but it seems that also checking
> full security specification from the saem_ref cube may avoid later regression
> due to change in underlying cube.
>
> Related to extranet #19216837
>
> diff --git a/test/test_security.py b/test/test_security.py
> --- a/test/test_security.py
> +++ b/test/test_security.py
> @@ -90,10 +90,11 @@ class NonManagerUserTC(CubicWebTC):
>          with self.new_access(self.login).cnx() as cnx:
>              profile = testutils.setup_profile(cnx)
>              cnx.commit()
>              profile.cw_set(user_annotation=u'meh')
>              cnx.commit()
> +
>              profile.cw_adapt_to('IWorkflowable').fire_transition('publish')
>              cnx.commit()
>              testutils.setup_profile(cnx, title=u'Clone', new_version_of=profile)
>              cnx.commit()
>  
> @@ -397,13 +398,21 @@ class ManagerUserTC(CubicWebTC):
>              profile = testutils.setup_profile(cnx, title=u'pp')
>              cnx.commit()
>              # Profile in draft, modifications are allowed.
>              profile.cw_set(title=u'ugh')
>              cnx.commit()
> +            comment = cnx.create_entity('SEDAComment', seda_comment=profile)
> +            cnx.commit()
>              # Profile published, no modification allowed.
>              profile.cw_adapt_to('IWorkflowable').fire_transition('publish')
>              cnx.commit()
> +            with self.assertUnauthorized(cnx):
> +                profile.cw_set(title=u'huugh')
> +            with self.assertUnauthorized(cnx):
> +                comment.cw_delete()
> +            with self.assertUnauthorized(cnx):
> +                cnx.create_entity('SEDAArchivalAgreement', seda_archival_agreement=profile)
>  
>      def test_conceptscheme_wf_permissions(self):
>          with self.admin_access.cnx() as cnx:
>              scheme = cnx.create_entity('ConceptScheme', ark_naa=testutils.naa(cnx))
>              cnx.commit()
>

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org



More information about the saem-devel mailing list