From 2ec603a518186fce0bd1ce3d6417f0ec72d32c52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Ba=C3=B1ados=20Schwerter?= Date: Tue, 16 Jul 2024 23:19:32 +0000 Subject: [PATCH] Fixed unit test --- src/CreeDictionary/tests/API_tests/model_test.py | 8 ++++---- src/CreeDictionary/tests/conftest.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/CreeDictionary/tests/API_tests/model_test.py b/src/CreeDictionary/tests/API_tests/model_test.py index 03ed5839c..887768b0a 100644 --- a/src/CreeDictionary/tests/API_tests/model_test.py +++ b/src/CreeDictionary/tests/API_tests/model_test.py @@ -81,11 +81,11 @@ def test_search_for_exact_lemma(lemma: Wordform): exact_match = exact_matches.pop() assert exact_match.source_language_match == lemma.text assert not exact_match.preverbs - # todo: enable the two lines below when #230 is fixed + # the two lines below are enabled after #230 was fixed # https://github.com/UAlbertaALTLab/morphodict/issues/230 - # or there will be flaky local tests and ci tests - # assert len(exact_match.definitions) >= 1 - # assert all(len(dfn.source_ids) >= 1 for dfn in exact_match.definitions) + # or there would be flaky local tests and ci tests + assert len(exact_match.wordform.definitions.all()) >= 1 + assert all(len(dfn.source_ids) >= 1 for dfn in exact_match.wordform.definitions.all()) @pytest.mark.django_db diff --git a/src/CreeDictionary/tests/conftest.py b/src/CreeDictionary/tests/conftest.py index ccbab1a55..d629e5bf6 100644 --- a/src/CreeDictionary/tests/conftest.py +++ b/src/CreeDictionary/tests/conftest.py @@ -51,4 +51,4 @@ def lemmas(): """ Strategy to return lemmas from the database. """ - return WordformStrategy(is_lemma=True) + return WordformStrategy(is_lemma=True,raw_analysis__isnull=False)