'Filter for updated date.'

def test_forums_filter_updated(self):

    post_updated_ds = datetime(2010, 5, 3, 12, 0)
    thread1 = ThreadFactory(title=u't1    audio')
    PostFactory(thread=thread1, created=post_updated_ds)
    thread2 = ThreadFactory(title=u't2    audio')
    PostFactory(thread=thread2, created=(post_updated_ds + timedelta(days=2)))
    self.refresh()
    qs = {'a': 1, 'w': 4, 'format': 'json', 'sortby': 1, 'updated_date': '05/04/2010'}
    qs['updated'] = constants.INTERVAL_BEFORE
    response = self.client.get(reverse('search.advanced'), qs)
    results = json.loads(response.content)['results']
    eq_([thread1.get_absolute_url()], [r['url'] for r in results])
    qs['updated'] = constants.INTERVAL_AFTER
    response = self.client.get(reverse('search.advanced'), qs)
    results = json.loads(response.content)['results']
    eq_([thread2.get_absolute_url()], [r['url'] for r in results])
