'Ensure that the custom ModelForm\'s `Meta.exclude` is overridden if
`ModelAdmin.exclude` or `InlineModelAdmin.exclude` are defined.
Refs #14496.'

def test_custom_form_meta_exclude(self):

    class AdminBandForm(forms.ModelForm, ):
        class Meta:
            model = Band
            exclude = [u'bio']
    class BandAdmin(ModelAdmin, ):
        exclude = [u'name']
        form = AdminBandForm
    ma = BandAdmin(Band, self.site)
    self.assertEqual(list(ma.get_form(request).base_fields), [u'bio', u'sign_date'])
    class AdminConcertForm(forms.ModelForm, ):
        class Meta:
            model = Concert
            exclude = [u'day']
    class ConcertInline(TabularInline, ):
        exclude = [u'transport']
        form = AdminConcertForm
        fk_name = u'main_band'
        model = Concert
    class BandAdmin(ModelAdmin, ):
        inlines = [ConcertInline]
    ma = BandAdmin(Band, self.site)
    self.assertEqual(list(list(ma.get_formsets(request))[0]().forms[0].fields), [u'main_band', u'opening_band', u'day', u'id', u'DELETE'])
