  
          cls._module.urlpatterns = cls.urlpatterns
  
          cls._override.enable()
          super(URLPatternsTestCase, cls).setUpClass()
  
      @classmethod
      def tearDownClass(cls):
          super(URLPatternsTestCase, cls).tearDownClass()
          cls._override.disable()
 
</s> remove         super(URLPatternsTestCase, cls).tearDownClass()
 </s> add         super().tearDownClass() </s> remove         super(TestUrlPatternTestCase, cls).setUpClass()
 </s> add         super().setUpClass() </s> remove         super(TestUrlPatternTestCase, cls).tearDownClass()
 </s> add         super().tearDownClass() </s> remove         return super(RelatedField, cls).__new__(cls, *args, **kwargs)
 </s> add         return super().__new__(cls, *args, **kwargs) </s> remove         return super(BaseSerializer, cls).__new__(cls, *args, **kwargs)
 </s> add         return super().__new__(cls, *args, **kwargs)
        super().setUpClass()
  
          cls._module.urlpatterns = cls.urlpatterns
  
          cls._override.enable()
        super().setUpClass()
  
      @classmethod
      def tearDownClass(cls):
          super(URLPatternsTestCase, cls).tearDownClass()
          cls._override.disable()
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