def test_disallow_if_frame_role_is_anonymous(self): with self.app.test_request_context(): flask.g.user_roles = ['Anonymous'] self.assertFalse(views.edit_is_allowed())
def test_allow_if_frame_role_is_contributor(self): with self.app.test_request_context(): flask.g.user_roles = ['Contributor'] self.assertTrue(views.edit_is_allowed())
def test_anything_allowed_if_authorization_is_disabled(self): self.app.config['SKIP_EDIT_AUTHORIZATION'] = True with self.app.test_request_context(): self.assertTrue(views.edit_is_allowed())