def test_DELETE_admin_only(self): script = factory.make_Script() response = self.client.delete(self.get_script_uri(script)) self.assertThat(response, HasStatusCode(http.client.FORBIDDEN)) self.assertIsNotNone(reload_object(script))
def test_POST_requires_admin(self): response = self.client.post(self.get_scripts_uri()) self.assertThat(response, HasStatusCode(http.client.FORBIDDEN))