mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-03 23:00:31 +00:00
Chore: Give the search index directory one owner in the tests (#14217)
Two fixtures created a temporary index directory and pointed INDEX_DIR at it, and paperless_dirs did the same, so a test that requested more than one got whichever assignment ran last. The search conftest no longer defines its own index_dir fixture, the tests that took it read paperless_dirs.index_dir instead, and _search_index is now a thin wrapper that requests paperless_dirs. The fixture that yields a Document is renamed from indexed_document to searchable_document so it no longer differs by one character from the index_document factory next to it.
This commit is contained in:
@@ -33,7 +33,7 @@ class TestSearchQueryErrorStillBecomesA400:
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
indexed_document: Document,
|
||||
searchable_document: Document,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
@@ -68,7 +68,7 @@ class TestLibraryDefectsPropagate:
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
indexed_document: Document,
|
||||
searchable_document: Document,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
@@ -98,7 +98,7 @@ class TestLibraryDefectsPropagate:
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
indexed_document: Document,
|
||||
searchable_document: Document,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
@@ -141,7 +141,7 @@ class TestSelectionPathsAgreeWithSearch:
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
indexed_document: Document,
|
||||
searchable_document: Document,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
@@ -181,7 +181,7 @@ class TestSelectionPathsAgreeWithSearch:
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
indexed_document: Document,
|
||||
searchable_document: Document,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
@@ -221,7 +221,7 @@ class TestSelectionPathsAgreeWithSearch:
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
indexed_document: Document,
|
||||
searchable_document: Document,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
@@ -259,7 +259,7 @@ class TestSelectionPathsAgreeWithSearch:
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
indexed_document: Document,
|
||||
searchable_document: Document,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
@@ -287,7 +287,7 @@ class TestSelectionPathsAgreeWithSearch:
|
||||
{
|
||||
"documents": [],
|
||||
"all": True,
|
||||
"filters": {"more_like_id": indexed_document.pk},
|
||||
"filters": {"more_like_id": searchable_document.pk},
|
||||
},
|
||||
format="json",
|
||||
)
|
||||
@@ -298,7 +298,7 @@ class TestSelectionPathsAgreeWithSearch:
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
indexed_document: Document,
|
||||
searchable_document: Document,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
@@ -328,7 +328,7 @@ class TestSelectionPathsAgreeWithSearch:
|
||||
{
|
||||
"documents": [],
|
||||
"all": True,
|
||||
"filters": {"more_like_id": indexed_document.pk},
|
||||
"filters": {"more_like_id": searchable_document.pk},
|
||||
},
|
||||
format="json",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user