Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions mediacloud/test/api_search_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/")


Expand Down Expand Up @@ -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']
Expand Down
Loading