def test_extra_field_kwargs_required(self):
        class TestSerializer(serializers.ModelSerializer):
            class Meta:
                model = RegularFieldsModel
                fields = ('auto_field', 'char_field')
                extra_kwargs = {'auto_field': {'required': False, 'read_only': False}}

        expected = dedent("""
            TestSerializer():
                auto_field = IntegerField(read_only=False, required=False)
                char_field = CharField(max_length=100)
        """)
        self.assertEqual(repr(TestSerializer()), expected)
Ensure `extra_kwargs` are passed to generated fields.
dataset/ETHPy150Open tomchristie/django-rest-framework/tests/test_model_serializer.py/TestRegularFieldMappings.test_extra_field_kwargs_required