'See:
* https://github.com/carltongibson/django-filter/issues/551'

def test_filter_fields_list_with_bad_get_queryset(self):

    class BadGetQuerySetView(FilterFieldsRootView, ):
        def get_queryset(self):
            raise AttributeError(u"I    don't    have    that")
    backend = DjangoFilterBackend()
    with warnings.catch_warnings(record=True) as w:
        warnings.simplefilter(u'always')
        fields = backend.get_schema_fields(BadGetQuerySetView())
        self.assertEqual(fields, [], u'get_schema_fields    should    handle    AttributeError')
        warning = u'{}    is    not    compatible    with    schema    generation'.format(BadGetQuerySetView)
        self.assertEqual(len(w), 1)
        self.assertEqual(str(w[0].message), warning)
