      def test_generate_key_returns_string(self):
          """Ensure generate_key returns a string"""
          token = self.model()
          key = token.generate_key()
          self.assertTrue(isinstance(key, six.string_types))
  
      def test_token_login_json(self):
          """Ensure token login view using JSON POST works."""
          client = APIClient(enforce_csrf_checks=True)
          response = client.post(
 
</s> remove         self.assertTrue(bool(token.key))
 </s> add         assert bool(token.key) </s> remove         self.assertEqual(response.status_code, 400)
 </s> add         assert response.status_code == 400 </s> remove         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)
 </s> add         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 </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)
 </s> add         assert response.status_code == status.HTTP_200_OK
        assert isinstance(key, six.string_types)
      def test_generate_key_returns_string(self):
          """Ensure generate_key returns a string"""
          token = self.model()
          key = token.generate_key()
        assert isinstance(key, six.string_types)
  
      def test_token_login_json(self):
          """Ensure token login view using JSON POST works."""
          client = APIClient(enforce_csrf_checks=True)
          response = client.post(
keep keep keep keep replace keep keep keep keep keep
 converted authentication_test asserts to pytest 
tests/test_authentication.py