@@ -67,29 +67,6 @@ def create_with_dates(self, **kwargs):
6767 ** kwargs ,
6868 )
6969
70- def test_api_token_authentication (self ):
71- # Reset the pre-set credentials
72- self .csrf_client .credentials ()
73-
74- response = self .client .get (self .scan_list_url )
75- self .assertEqual (status .HTTP_401_UNAUTHORIZED , response .status_code )
76-
77- auth = ""
78- response = self .csrf_client .get (self .scan_list_url , HTTP_AUTHORIZATION = auth )
79- self .assertEqual (status .HTTP_401_UNAUTHORIZED , response .status_code )
80-
81- auth = self .header_prefix
82- response = self .csrf_client .get (self .scan_list_url , HTTP_AUTHORIZATION = auth )
83- self .assertEqual (status .HTTP_401_UNAUTHORIZED , response .status_code )
84-
85- auth = self .header_prefix + "bad_token"
86- response = self .csrf_client .get (self .scan_list_url , HTTP_AUTHORIZATION = auth )
87- self .assertEqual (status .HTTP_401_UNAUTHORIZED , response .status_code )
88-
89- auth = self .header_prefix + self .token .key
90- response = self .csrf_client .get (self .scan_list_url , HTTP_AUTHORIZATION = auth )
91- self .assertEqual (status .HTTP_200_OK , response .status_code )
92-
9370 def test_api_scan_list_endpoint_results (self ):
9471 response = self .csrf_client .get (self .scan_list_url )
9572 self .assertContains (response , self .scan1_detail_url )
0 commit comments