예제 #1
0
 def test_list_no_auth(self):
     response = auth_util.list_test(self.client, self.model_name)
     self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
예제 #2
0
 def test_list_auth(self):
     response = \
         auth_util.list_test(self.client, self.model_name, auth=True)
     self.assertEqual(response.status_code, status.HTTP_200_OK)
예제 #3
0
 def test_list_auth(self):
     """
     Forbidden for non-admin users.
     """
     response = auth_util.list_test(self.client, self.model_name, True)
     self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)