diff --git a/arkindex_worker/worker/classification.py b/arkindex_worker/worker/classification.py index 54e098623a9efa2d9cdce38bd81545591e46a088..ee1e1b2da1f8712490a371442be698068cf3b51b 100644 --- a/arkindex_worker/worker/classification.py +++ b/arkindex_worker/worker/classification.py @@ -36,7 +36,6 @@ class ClassificationMixin(object): :param ml_class str: Name of the MLClass. :returns str: ID of the retrieved or created MLClass. """ - if not self.classes.get(self.corpus_id): self.load_corpus_classes() diff --git a/tests/test_elements_worker/test_entities.py b/tests/test_elements_worker/test_entities.py index 41e53644834137a116f1248c60418a72421a30cb..84963d796675ff02a2090c3f99fdbe0c2eed7937 100644 --- a/tests/test_elements_worker/test_entities.py +++ b/tests/test_elements_worker/test_entities.py @@ -94,6 +94,7 @@ def test_create_entity_wrong_corpus(monkeypatch, mock_elements_worker): elt = Element({"id": "12341234-1234-1234-1234-123412341234"}) # Triggering an error on metas param, not giving corpus should work since + # ARKINDEX_CORPUS_ID environment variable is set on mock_elements_worker with pytest.raises(AssertionError) as e: mock_elements_worker.create_entity( element=elt,