コード例 #1
0
ファイル: test_security.py プロジェクト: timgates42/Kotti
    def test_set_roles(self):
        from kotti.security import ROLES
        from kotti.security import set_roles
        from kotti.security import reset_roles

        before = ROLES.copy()
        set_roles({"role:admin": ROLES["role:admin"]})
        assert ROLES == {"role:admin": ROLES["role:admin"]}
        reset_roles()
        assert ROLES == before
コード例 #2
0
    def test_set_roles(self):
        from kotti.security import ROLES
        from kotti.security import set_roles
        from kotti.security import reset_roles

        before = ROLES.copy()
        set_roles({'role:admin': ROLES['role:admin']})
        assert ROLES == {'role:admin': ROLES['role:admin']}
        reset_roles()
        assert ROLES == before