                  fields = ['array_field', 'array_field_with_blank']
  
          expected = dedent("""
              TestSerializer():
                  array_field = ListField(allow_empty=False, child=CharField(label='Array field', validators=[<django.core.validators.MaxLengthValidator object>]))
                  array_field_with_blank = ListField(child=CharField(label='Array field with blank', validators=[<django.core.validators.MaxLengthValidator object>]), required=False)
          """)
          self.assertEqual(repr(TestSerializer()), expected)
  
      @pytest.mark.skipif(hasattr(models, 'JSONField'), reason='has models.JSONField')
      def test_json_field(self):
          class JSONFieldModel(models.Model):
 
</s> remove             return timezone.make_naive(value, utc)
 </s> add             return timezone.make_naive(value, datetime.timezone.utc) </s> remove         django40: Django>=4.0,<5.0
 </s> add         django40: Django>=4.0,<4.1
        django41: Django>=4.1a1,<4.2
                array_field = ListField(allow_empty=False, child=CharField(label='Array field'%s))
                array_field_with_blank = ListField(child=CharField(label='Array field with blank'%s), required=False)
        """ % (validators, validators))
                  fields = ['array_field', 'array_field_with_blank']
  
          expected = dedent("""
              TestSerializer():
                array_field = ListField(allow_empty=False, child=CharField(label='Array field'%s))
                array_field_with_blank = ListField(child=CharField(label='Array field with blank'%s), required=False)
        """ % (validators, validators))
                array_field = ListField(allow_empty=False, child=CharField(label='Array field'%s))
                array_field_with_blank = ListField(child=CharField(label='Array field with blank'%s), required=False)
        """ % (validators, validators))
                array_field = ListField(allow_empty=False, child=CharField(label='Array field'%s))
                array_field_with_blank = ListField(child=CharField(label='Array field with blank'%s), required=False)
        """ % (validators, validators))
          self.assertEqual(repr(TestSerializer()), expected)
  
      @pytest.mark.skipif(hasattr(models, 'JSONField'), reason='has models.JSONField')
      def test_json_field(self):
          class JSONFieldModel(models.Model):
keep keep keep keep replace replace replace keep keep keep keep keep
 Confirmed support for Django 4.1. (#8498) 
tests/test_model_serializer.py