      many_to_many = models.ManyToManyField(ManyToManyTargetModel, related_name='reverse_many_to_many')
      one_to_one = models.OneToOneField(OneToOneTargetModel, related_name='reverse_one_to_one')
  
  
  RELATIONAL_FLAT_REPR = """
  TestSerializer():
      id = IntegerField(label='ID', read_only=True)
      foreign_key = PrimaryKeyRelatedField(queryset=ForeignKeyTargetModel.objects.all())
      one_to_one = PrimaryKeyRelatedField(queryset=OneToOneTargetModel.objects.all())
      many_to_many = PrimaryKeyRelatedField(many=True, queryset=ManyToManyTargetModel.objects.all())
  """.strip()
  
  
  RELATIONAL_NESTED_REPR = """
  TestSerializer():
      id = IntegerField(label='ID', read_only=True)
      foreign_key = NestedModelSerializer(read_only=True):
          id = IntegerField(label='ID', read_only=True)
          name = CharField(max_length=100)
      one_to_one = NestedModelSerializer(read_only=True):
          id = IntegerField(label='ID', read_only=True)
          name = CharField(max_length=100)
      many_to_many = NestedModelSerializer(many=True, read_only=True):
          id = IntegerField(label='ID', read_only=True)
          name = CharField(max_length=100)
  """.strip()
  
  
  HYPERLINKED_FLAT_REPR = """
  TestSerializer():
      url = HyperlinkedIdentityField(view_name='relationalmodel-detail')
      foreign_key = HyperlinkedRelatedField(queryset=ForeignKeyTargetModel.objects.all(), view_name='foreignkeytargetmodel-detail')
      one_to_one = HyperlinkedRelatedField(queryset=OneToOneTargetModel.objects.all(), view_name='onetoonetargetmodel-detail')
      many_to_many = HyperlinkedRelatedField(many=True, queryset=ManyToManyTargetModel.objects.all(), view_name='manytomanytargetmodel-detail')
  """.strip()
  
  
  HYPERLINKED_NESTED_REPR = """
  TestSerializer():
      url = HyperlinkedIdentityField(view_name='relationalmodel-detail')
      foreign_key = NestedModelSerializer(read_only=True):
          id = IntegerField(label='ID', read_only=True)
          name = CharField(max_length=100)
      one_to_one = NestedModelSerializer(read_only=True):
          id = IntegerField(label='ID', read_only=True)
          name = CharField(max_length=100)
      many_to_many = NestedModelSerializer(many=True, read_only=True):
          id = IntegerField(label='ID', read_only=True)
          name = CharField(max_length=100)
  """.strip()
  
  
  class TestSerializerMappings(TestCase):
      maxDiff = 10000
  
      def test_regular_fields(self):
          class TestSerializer(serializers.ModelSerializer):
              class Meta:
                  model = RegularFieldsModel
          self.assertEqual(repr(TestSerializer()), REGULAR_FIELDS_REPR)
  
      def test_flat_relational_fields(self):
          class TestSerializer(serializers.ModelSerializer):
              class Meta:
                  model = RelationalModel
          self.assertEqual(repr(TestSerializer()), RELATIONAL_FLAT_REPR)
 
</s> remove         self.assertEqual(repr(TestSerializer()), RELATIONAL_NESTED_REPR)
 </s> add         expected = dedent("""
            TestSerializer():
                id = IntegerField(label='ID', read_only=True)
                foreign_key = NestedModelSerializer(read_only=True):
                    id = IntegerField(label='ID', read_only=True)
                    name = CharField(max_length=100)
                one_to_one = NestedModelSerializer(read_only=True):
                    id = IntegerField(label='ID', read_only=True)
                    name = CharField(max_length=100)
                many_to_many = NestedModelSerializer(many=True, read_only=True):
                    id = IntegerField(label='ID', read_only=True)
                    name = CharField(max_length=100)
        """)
        self.assertEqual(repr(TestSerializer()), expected) </s> remove         self.assertEqual(repr(TestSerializer()), HYPERLINKED_NESTED_REPR)
 </s> add         expected = dedent("""
            TestSerializer():
                url = HyperlinkedIdentityField(view_name='relationalmodel-detail')
                foreign_key = NestedModelSerializer(read_only=True):
                    id = IntegerField(label='ID', read_only=True)
                    name = CharField(max_length=100)
                one_to_one = NestedModelSerializer(read_only=True):
                    id = IntegerField(label='ID', read_only=True)
                    name = CharField(max_length=100)
                many_to_many = NestedModelSerializer(many=True, read_only=True):
                    id = IntegerField(label='ID', read_only=True)
                    name = CharField(max_length=100)
            """)
        self.assertEqual(repr(TestSerializer()), expected) </s> remove         self.assertEqual(repr(TestSerializer()), RELATIONAL_FLAT_REPR)
 </s> add         expected = dedent("""
            TestSerializer():
                id = IntegerField(label='ID', read_only=True)
                foreign_key = PrimaryKeyRelatedField(queryset=ForeignKeyTargetModel.objects.all())
                one_to_one = PrimaryKeyRelatedField(queryset=OneToOneTargetModel.objects.all())
                many_to_many = PrimaryKeyRelatedField(many=True, queryset=ManyToManyTargetModel.objects.all())
        """)
        self.assertEqual(repr(TestSerializer()), expected) </s> remove         self.assertEqual(repr(TestSerializer()), HYPERLINKED_FLAT_REPR)
 </s> add         expected = dedent("""
            TestSerializer():
                url = HyperlinkedIdentityField(view_name='relationalmodel-detail')
                foreign_key = HyperlinkedRelatedField(queryset=ForeignKeyTargetModel.objects.all(), view_name='foreignkeytargetmodel-detail')
                one_to_one = HyperlinkedRelatedField(queryset=OneToOneTargetModel.objects.all(), view_name='onetoonetargetmodel-detail')
                many_to_many = HyperlinkedRelatedField(many=True, queryset=ManyToManyTargetModel.objects.all(), view_name='manytomanytargetmodel-detail')
        """)
        self.assertEqual(repr(TestSerializer()), expected) </s> remove REGULAR_FIELDS_REPR = """
TestSerializer():
    auto_field = IntegerField(read_only=True)
    big_integer_field = IntegerField()
    boolean_field = BooleanField(default=False)
    char_field = CharField(max_length=100)
    comma_seperated_integer_field = CharField(max_length=100, validators=[<django.core.validators.RegexValidator object>])
    date_field = DateField()
    datetime_field = DateTimeField()
    decimal_field = DecimalField(decimal_places=1, max_digits=3)
    email_field = EmailField(max_length=100)
    float_field = FloatField()
    integer_field = IntegerField()
    null_boolean_field = BooleanField(required=False)
    positive_integer_field = IntegerField()
    positive_small_integer_field = IntegerField()
    slug_field = SlugField(max_length=100)
    small_integer_field = IntegerField()
    text_field = CharField()
    time_field = TimeField()
    url_field = URLField(max_length=100)
""".strip()
 </s> add class TestRegularFieldMappings(TestCase):
    def test_regular_fields(self):
        class TestSerializer(serializers.ModelSerializer):
            class Meta:
                model = RegularFieldsModel

        expected = dedent("""
            TestSerializer():
                auto_field = IntegerField(read_only=True)
                big_integer_field = IntegerField()
                boolean_field = BooleanField(default=False)
                char_field = CharField(max_length=100)
                comma_seperated_integer_field = CharField(max_length=100, validators=[<django.core.validators.RegexValidator object>])
                date_field = DateField()
                datetime_field = DateTimeField()
                decimal_field = DecimalField(decimal_places=1, max_digits=3)
                email_field = EmailField(max_length=100)
                float_field = FloatField()
                integer_field = IntegerField()
                null_boolean_field = BooleanField(required=False)
                positive_integer_field = IntegerField()
                positive_small_integer_field = IntegerField()
                slug_field = SlugField(max_length=100)
                small_integer_field = IntegerField()
                text_field = CharField()
                time_field = TimeField()
                url_field = URLField(max_length=100)
        """)

        self.assertEqual(repr(TestSerializer()), expected)
class TestRelationalFieldMappings(TestCase):
      many_to_many = models.ManyToManyField(ManyToManyTargetModel, related_name='reverse_many_to_many')
      one_to_one = models.OneToOneField(OneToOneTargetModel, related_name='reverse_one_to_one')
  
  
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
class TestRelationalFieldMappings(TestCase):
      def test_flat_relational_fields(self):
          class TestSerializer(serializers.ModelSerializer):
              class Meta:
                  model = RelationalModel
          self.assertEqual(repr(TestSerializer()), RELATIONAL_FLAT_REPR)
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Clean up field mapping tests 
tests/test_model_field_mappings.py