          self.handler._force_user = None
          self.handler._force_token = None
  
          if self.session:
              super(APIClient, self).logout()
  
  
  class APITransactionTestCase(testcases.TransactionTestCase):
      client_class = APIClient
  
 
</s> remove class BaseTokenAuthTests(object):
 </s> add class BaseTokenAuthTests: </s> remove         class DummyView(object):
 </s> add         class DummyView: </s> remove         self.assertEqual(unicode_repr(TestSerializer()), expected)
 </s> add         self.assertEqual(repr(TestSerializer()), expected) </s> remove         class MockResponse(object):
 </s> add         class MockResponse: </s> remove         super(SchemaView, self).__init__(*args, **kwargs)
 </s> add         super().__init__(*args, **kwargs)
            super().logout()
          self.handler._force_user = None
          self.handler._force_token = None
  
          if self.session:
            super().logout()
  
  
  class APITransactionTestCase(testcases.TransactionTestCase):
      client_class = APIClient
  
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> 
rest_framework/test.py