

def test_search_fields(self):
    '\n        Search for errors like this:\n        Bad search field <customer__user__username> for Customer model.\n        '
    for (model, model_admin) in six.iteritems(admin.site._registry):
        for search_field in getattr(model_admin, 'search_fields', []):
            model_name = model_admin.model.__name__
            self.assertFalse(search_field.startswith('{table_name}__'.format(table_name=model_name.lower())), 'Bad search field <{search_field}> for {model_name} model.'.format(search_field=search_field, model_name=model_admin))

dataset/ETHPy150Open pydanny/dj-stripe/tests/test_admin.py TestAdminSite.test_search_fields/VarMisuse@87/186 `model_name`->`model_admin`