  
  
  class GetObjectOr404Tests(TestCase):
      def setUp(self):
          super(GetObjectOr404Tests, self).setUp()
          self.uuid_object = UUIDForeignKeyTarget.objects.create(name='bar')
  
      def test_get_object_or_404_with_valid_uuid(self):
          obj = generics.get_object_or_404(
              UUIDForeignKeyTarget, pk=self.uuid_object.pk
 
</s> remove         class MockQueryset(object):
 </s> add         class MockQueryset: </s> remove         super(TestHyperlinkedRelatedField, self).setUp()
 </s> add         super().setUp() </s> remove         class MockResponse(object):
 </s> add         class MockResponse: </s> remove         class MockRequest(object):
 </s> add         class MockRequest: </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')
        super().setUp()
  
  
  class GetObjectOr404Tests(TestCase):
      def setUp(self):
        super().setUp()
          self.uuid_object = UUIDForeignKeyTarget.objects.create(name='bar')
  
      def test_get_object_or_404_with_valid_uuid(self):
          obj = generics.get_object_or_404(
              UUIDForeignKeyTarget, pk=self.uuid_object.pk
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/test_generics.py