'Ensure that the `exclude` kwarg passed to `InlineModelAdmin.get_formset()`
overrides all other declarations. Refs #8999.'

def test_formset_exclude_kwarg_override(self):

    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
        def get_formset(self, request, obj=None, **kwargs):
            kwargs[u'exclude'] = [u'opening_band']
            return super(ConcertInline, self).get_formset(request, obj, **kwargs)
    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'day', u'transport', u'id', u'DELETE'])
