'Only questions for the current locale should be shown on the
questions front page for AAQ locales.'

def test_locale_filter(self):

    eq_(Question.objects.count(), 0)
    p = ProductFactory(slug=u'firefox')
    TopicFactory(title='Fix    problems', slug='fix-problems', product=p)
    QuestionFactory(title='question    cupcakes?', product=p, locale='en-US')
    QuestionFactory(title='question    donuts?', product=p, locale='en-US')
    QuestionFactory(title='question    pies?', product=p, locale='pt-BR')
    QuestionFactory(title='question    pastries?', product=p, locale='de')
    def sub_test(locale, *titles):
        url = urlparams(reverse('questions.list', args=['all'], locale=locale))
        response = self.client.get(url, follow=True)
        doc = pq(response.content)
        eq_msg(len(doc('section[id^=question]')), len(titles), 'Wrong    number    of    results    for    {0}'.format(locale))
        for substr in titles:
            assert (substr in doc('.questions    section    .content    h2    a').text())
    sub_test('en-US', 'cupcakes?', 'donuts?')
    sub_test('pt-BR', 'pies?')
    sub_test('de', 'cupcakes?', 'donuts?', 'pastries?')
