Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • workers/base-worker
1 result
Show changes
Commits on Source (2)
......@@ -1978,7 +1978,9 @@ def test_list_transcriptions_with_cache(
# Query database through cache
transcriptions = mock_elements_worker_with_cache.list_transcriptions(**filters)
assert transcriptions.count() == len(expected_ids)
for transcription, expected_id in zip(transcriptions.order_by("id"), expected_ids):
for transcription, expected_id in zip(
transcriptions.order_by(CachedTranscription.id), expected_ids
):
assert transcription.id == UUID(expected_id)
# Check the worker never hits the API for elements
......
......@@ -7,11 +7,6 @@ from arkindex.mock import MockApiClient
from arkindex_worker.worker.base import BaseWorker
@pytest.fixture
def mock_api_client() -> MockApiClient:
return MockApiClient()
@pytest.fixture(autouse=True)
def setup_environment(responses, monkeypatch) -> None:
"""Setup needed environment variables"""
......@@ -31,6 +26,6 @@ def setup_environment(responses, monkeypatch) -> None:
# Setup a mock api client instead of using a real one
def mock_setup_api_client(self):
self.api_client = mock_api_client
self.api_client = MockApiClient()
monkeypatch.setattr(BaseWorker, "setup_api_client", mock_setup_api_client)