              TestChildModelSerializer():
                  value = CharField(max_length=64, validators=[<UniqueValidator(queryset=TestChildModel.objects.all())>])
                  parent = PrimaryKeyRelatedField(queryset=TestParentModel.objects.all())
          """)
          self.assertEqual(unicode_repr(TestChildModelSerializer()), child_expected)
  
      def test_nonID_PK_foreignkey_model_serializer(self):
  
          class TestChildModelSerializer(serializers.ModelSerializer):
              class Meta:
 
</s> remove         self.assertEqual(unicode_repr(TestParentModelSerializer()), parent_expected)
 </s> add         self.assertEqual(repr(TestParentModelSerializer()), parent_expected) </s> remove         self.assertEqual(unicode_repr(ChildSerializer()), child_expected)
        self.assertEqual(unicode_repr(TestSerializer()), test_expected)
        self.assertEqual(unicode_repr(ChildSerializer()), child_expected)
 </s> add         self.assertEqual(repr(ChildSerializer()), child_expected)
        self.assertEqual(repr(TestSerializer()), test_expected)
        self.assertEqual(repr(ChildSerializer()), child_expected) </s> remove         self.assertEqual(unicode_repr(TestSerializer()), expected)
 </s> add         self.assertEqual(repr(TestSerializer()), expected) </s> remove         self.assertEqual(unicode_repr(TestSerializer()), expected)
 </s> add         self.assertEqual(repr(TestSerializer()), expected) </s> remove         self.assertEqual(unicode_repr(TestSerializer()), expected)
 </s> add         self.assertEqual(repr(TestSerializer()), expected)
        self.assertEqual(repr(TestChildModelSerializer()), child_expected)
              TestChildModelSerializer():
                  value = CharField(max_length=64, validators=[<UniqueValidator(queryset=TestChildModel.objects.all())>])
                  parent = PrimaryKeyRelatedField(queryset=TestParentModel.objects.all())
          """)
        self.assertEqual(repr(TestChildModelSerializer()), child_expected)
  
      def test_nonID_PK_foreignkey_model_serializer(self):
  
          class TestChildModelSerializer(serializers.ModelSerializer):
              class Meta:
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_model_serializer.py