Skip to content

Commit

Permalink
Fix broken tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbernstein committed Jun 4, 2024
1 parent 07a0a08 commit a90c43e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions tests/manager/celery/tasks/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ def test_PP_1332_fiction_returns_results(
work1 = db.work(with_open_access_download=True, fiction=True)
work2 = db.work(with_open_access_download=True, fiction=False)
documents = get_work_search_documents(db.session, 2, 0)
assert [doc["_id"] for doc in documents] == [work2.id, work1.id]
assert "nonfiction" == documents[0]["fiction"]
assert "fiction" == documents[1]["fiction"]
assert {doc["_id"] for doc in documents} == {work2.id, work1.id}

end_to_end_search_fixture.populate_search_index()
end_to_end_search_fixture.expect_results(
expect=[work1, work2], ordered=False, query_string=""
Expand Down
4 changes: 2 additions & 2 deletions tests/manager/sqlalchemy/model/test_work.py
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ def assert_time_match(python, postgres):
search_doc["published"], tz=pytz.UTC
).date()
)
assert "Nonfiction" == search_doc["fiction"]
assert "nonfiction" == search_doc["fiction"]
assert "YoungAdult" == search_doc["audience"]
assert work.summary_text == search_doc["summary"]
assert work.quality == search_doc["quality"]
Expand Down Expand Up @@ -1471,7 +1471,7 @@ def compare(doc: dict[str, Any], work: Work) -> None:
)
assert doc["presentation_ready"] == work.presentation_ready
assert doc["last_update_time"] == work.last_update_time
assert doc["fiction"] == "Fiction" if work.fiction else "Nonfiction"
assert doc["fiction"] == "fiction" if work.fiction else "nonfiction"
assert doc["audience"] == work.audience
assert doc["summary"] == work.summary_text
assert doc["quality"] == work.quality
Expand Down

0 comments on commit a90c43e

Please sign in to comment.