'Regression test for #12203/#12237 - Fail more gracefully when a M2M field that
specifies the \'through\' option is included in the \'fields\' or the \'fieldsets\'
ModelAdmin options.'

def test_graceful_m2m_fail(self):

    class BookAdmin(admin.ModelAdmin, ):
        fields = ['authors']
    self.assertRaisesMessage(ImproperlyConfigured, "'BookAdmin.fields'    can't    include    the    ManyToManyField    field    'authors'    because    'authors'    manually    specifies    a    'through'    model.", BookAdmin.validate, Book)
