  
      def test_token_login_form(self):
          """Ensure token login view using form POST works."""
          client = APIClient(enforce_csrf_checks=True)
          response = client.post('/auth-token/',
                                 {'username': self.username, 'password': self.password})
          self.assertEqual(response.status_code, status.HTTP_200_OK)
          self.assertEqual(response.data['token'], self.key)
  
  
  @override_settings(ROOT_URLCONF='tests.test_authentication')
  class CustomTokenAuthTests(BaseTokenAuthTests, TestCase):
      model = CustomToken
 
</s> remove         self.assertEqual(response.status_code, 400)
 </s> add         assert response.status_code == 400 </s> remove         self.assertEqual(response.status_code, 400)
 </s> add         assert response.status_code == 400 </s> remove         self.assertEqual(response.status_code, status.HTTP_200_OK)
        self.assertEqual(response.data['token'], self.key)
 </s> add         assert response.status_code == status.HTTP_200_OK
        assert response.data['token'] == self.key </s> remove         self.assertTrue(isinstance(key, six.string_types))
 </s> add         assert isinstance(key, six.string_types) </s> remove         self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
 </s> add         assert response.status_code == status.HTTP_401_UNAUTHORIZED
        response = client.post(
            '/auth-token/',
            {'username': self.username, 'password': self.password}
        )
        assert response.status_code == status.HTTP_200_OK
        assert response.data['token'] == self.key
  
      def test_token_login_form(self):
          """Ensure token login view using form POST works."""
          client = APIClient(enforce_csrf_checks=True)
        response = client.post(
            '/auth-token/',
            {'username': self.username, 'password': self.password}
        )
        assert response.status_code == status.HTTP_200_OK
        assert response.data['token'] == self.key
        response = client.post(
            '/auth-token/',
            {'username': self.username, 'password': self.password}
        )
        assert response.status_code == status.HTTP_200_OK
        assert response.data['token'] == self.key
        response = client.post(
            '/auth-token/',
            {'username': self.username, 'password': self.password}
        )
        assert response.status_code == status.HTTP_200_OK
        assert response.data['token'] == self.key
        response = client.post(
            '/auth-token/',
            {'username': self.username, 'password': self.password}
        )
        assert response.status_code == status.HTTP_200_OK
        assert response.data['token'] == self.key
  
  
  @override_settings(ROOT_URLCONF='tests.test_authentication')
  class CustomTokenAuthTests(BaseTokenAuthTests, TestCase):
      model = CustomToken
keep keep keep keep replace replace replace replace keep keep keep keep keep
 converted authentication_test asserts to pytest 
tests/test_authentication.py