Skip to content

Commit 1f8ad94

Browse files
committed
Update tests
1 parent c36b397 commit 1f8ad94

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

readthedocs/search/tests/test_search_tasks.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ def test_partial_queries_are_not_recorded(self, api_client):
8787
SearchQuery.objects.all().first().query == 'stack overflow'
8888
), 'one SearchQuery should be there because partial queries gets updated'
8989

90-
def test_search_query_not_recorded_when_results_are_zero(self, api_client):
91-
"""Test that search queries are not recorded when they have zero results."""
90+
def test_search_query_recorded_when_results_are_zero(self, api_client):
91+
"""Test that search queries are recorded when they have zero results."""
9292

9393
assert (
9494
SearchQuery.objects.all().count() == 0
@@ -102,10 +102,8 @@ def test_search_query_not_recorded_when_results_are_zero(self, api_client):
102102
}
103103
resp = api_client.get(self.url, search_params)
104104

105-
assert (resp.data['count'] == 0)
106-
assert (
107-
SearchQuery.objects.all().count() == 0
108-
), 'there should be 0 obj since there were no results.'
105+
assert resp.data['count'] == 0
106+
assert SearchQuery.objects.all().count() == 1
109107

110108
def test_delete_old_search_queries_from_db(self, project):
111109
"""Test that the old search queries are being deleted."""

0 commit comments

Comments
 (0)