diff --git a/mediacloud/test/api_search_test.py b/mediacloud/test/api_search_test.py index fb59ba1..1ffb19d 100644 --- a/mediacloud/test/api_search_test.py +++ b/mediacloud/test/api_search_test.py @@ -14,7 +14,7 @@ START_DATE = dt.date(2023, 11, 1) END_DATE = dt.date(2023, 12, 1) -#Optionally override the target instance when testing, for staging/dev cases +# Optionally override the target instance when testing, for staging/dev cases mediacloud.api.BaseApi.BASE_API_URL = os.getenv("MC_API_BASE_URL", "https://search.mediacloud.org/api/") @@ -178,11 +178,13 @@ def test_story_list_sort_order(self): def test_search_by_indexed_date(self): # compare results with indexed_date clause to those without it - results1 = self._search.story_count(query="weather", start_date=START_DATE, end_date=END_DATE) + results1 = self._search.story_count(query="weather", start_date=START_DATE, end_date=END_DATE, + collection_ids=[COLLECTION_US_NATIONAL]) assert results1['total'] > 0 results2 = self._search.story_count(query="weather and indexed_date:[{} TO {}]".format( START_DATE.isoformat(), END_DATE.isoformat()), - start_date=START_DATE, end_date=END_DATE) + start_date=START_DATE, end_date=END_DATE, + collection_ids=[COLLECTION_US_NATIONAL]) assert results2['total'] > 0 assert results1['total'] == results2['total'] assert results1['relevant'] != results2['relevant']