'Test filtering results by locale.'

def test_locale_filter(self):

    today = date.today()
    for i in range(3):
        WikiMetricFactory(locale='es', date=(today - timedelta(days=i)))
    WikiMetricFactory(locale='fr')
    response = self.client.get(urlparams(reverse('api.wikimetric_list'), format='json', locale='es'))
    eq_(200, response.status_code)
    results = json.loads(response.content)['results']
    eq_(3, len(results))
    response = self.client.get(urlparams(reverse('api.wikimetric_list'), format='json', locale='fr'))
    eq_(200, response.status_code)
    results = json.loads(response.content)['results']
    eq_(1, len(results))
