'Ensure that the custom ModelForm\'s `Meta.exclude` is respected by
`GenericInlineModelAdmin.get_formset`, and overridden if
`ModelAdmin.exclude` or `GenericInlineModelAdmin.exclude` are defined.
Refs #15907.'

def test_custom_form_meta_exclude(self):

    class MediaForm(ModelForm, ):
        class Meta:
            model = Media
            exclude = [u'url']
    class MediaInline(GenericTabularInline, ):
        exclude = [u'description']
        form = MediaForm
        model = Media
    class EpisodeAdmin(admin.ModelAdmin, ):
        inlines = [MediaInline]
    ma = EpisodeAdmin(Episode, self.site)
    self.assertEqual(list(list(ma.get_formsets(request))[0]().forms[0].fields), [u'url', u'keywords', u'id', u'DELETE'])
    class MediaInline(GenericTabularInline, ):
        form = MediaForm
        model = Media
    class EpisodeAdmin(admin.ModelAdmin, ):
        inlines = [MediaInline]
    ma = EpisodeAdmin(Episode, self.site)
    self.assertEqual(list(list(ma.get_formsets(request))[0]().forms[0].fields), [u'description', u'keywords', u'id', u'DELETE'])
