diff --git a/tests/manager/celery/tasks/test_search.py b/tests/manager/celery/tasks/test_search.py index a29c765ff3..f1d7c2b256 100644 --- a/tests/manager/celery/tasks/test_search.py +++ b/tests/manager/celery/tasks/test_search.py @@ -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="" diff --git a/tests/manager/sqlalchemy/model/test_work.py b/tests/manager/sqlalchemy/model/test_work.py index b2307ec65f..d40ece5d12 100644 --- a/tests/manager/sqlalchemy/model/test_work.py +++ b/tests/manager/sqlalchemy/model/test_work.py @@ -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"] @@ -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