'Ensure locale override can find the only \'fr\' document.'

def test_language_filter_override(self):

    class LanguageView(SearchView, ):
        filter_backends = (SearchQueryBackend, LanguageFilterBackend)
    view = LanguageView.as_view()
    request = self.get_request('/en-US/search?q=pipe&locale=*')
    eq_(request.LANGUAGE_CODE, 'en-US')
    response = view(request)
    eq_(response.data['count'], 1)
    eq_(len(response.data['documents']), 1)
    eq_(response.data['documents'][0]['locale'], 'fr')
    request = self.get_request('/en-US/search?q=pipe')
    eq_(request.LANGUAGE_CODE, 'en-US')
    response = view(request)
    eq_(response.data['count'], 0)
    eq_(len(response.data['documents']), 0)
