def test_get_threads_filter_1_month_success(self):
        time_period = now().day

        t1 = Thread.objects.create(site=self.site, url='test_url')
        t2 = Thread.objects.create(
            site=self.site,
            url='test_url_2',
        )
        t2.created = now() - timedelta(days=time_period)
        t2.save()

        self.client.login(email="donald@duck.com", password="password")

        resp = self.client.post(
            reverse("c4all_admin:get_threads", args=[self.site.id, ]),
            {'interval': 'this_month'}
        )

        threads = resp.context['threads'].object_list

        self.assertTrue(t1 in threads)
        self.assertTrue(t2 not in threads)
dataset/ETHPy150Open c4all/c4all/admin/tests/thread.py/AdminThreadTestCases.test_get_threads_filter_1_month_success/original