示例#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)