      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(
 
</s> remove         content = six.b('qwerty')
 </s> add         content = b'qwerty' </s> remove         request = factory.patch('/{0}'.format(obj.pk), {'number_value': 98}, format='json')
 </s> add         request = factory.patch('/{}'.format(obj.pk), {'number_value': 98}, format='json') </s> remove         request = factory.patch('/{0}'.format(obj.pk), {'number_value': 101}, format='json')
 </s> add         request = factory.patch('/{}'.format(obj.pk), {'number_value': 101}, format='json') </s> remove             key = six.text_type(key)
 </s> add             key = str(key) </s> remove         assert isinstance(field.to_representation(Decimal('1.1')), six.string_types)
 </s> add         assert isinstance(field.to_representation(Decimal('1.1')), str)
        assert isinstance(key, str)
      def test_generate_key_returns_string(self):
          """Ensure generate_key returns a string"""
          token = self.model()
          key = token.generate_key()
        assert isinstance(key, str)
  
      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
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
tests/authentication/test_authentication.py