  
      def test_post_json_failing_token_auth(self):
          """Ensure POSTing json over token auth without correct credentials fails"""
          response = self.csrf_client.post('/token/', json.dumps({'example': 'example'}), 'application/json')
          self.assertEqual(response.status_code, 401)
  
      def test_token_has_auto_assigned_key_if_none_provided(self):
          """Ensure creating a token with no key will auto-assign a key"""
          self.token.delete()
          token = Token.objects.create(user=self.user)
 
</s> remove         self.assertEqual(response.status_code, 401)
 </s> add         self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) </s> remove         self.assertEqual(response.status_code, 200)
 </s> add         self.assertEqual(response.status_code, status.HTTP_200_OK) </s> remove         self.assertEqual(response.status_code, 401)
 </s> add         self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) </s> remove         self.assertEqual(response.status_code, 200)
 </s> add         self.assertEqual(response.status_code, status.HTTP_200_OK) </s> remove         self.assertEqual(response.status_code, 401)
 </s> add         self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
        self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
  
      def test_post_json_failing_token_auth(self):
          """Ensure POSTing json over token auth without correct credentials fails"""
          response = self.csrf_client.post('/token/', json.dumps({'example': 'example'}), 'application/json')
        self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
  
      def test_token_has_auto_assigned_key_if_none_provided(self):
          """Ensure creating a token with no key will auto-assign a key"""
          self.token.delete()
          token = Token.objects.create(user=self.user)
keep keep keep keep replace keep keep keep keep keep
 Replaced status numbers with the statuses constants from the status model. 
rest_framework/tests/authentication.py