Fix: Resolve more instances of tests which mutated global states (#12395)

This commit is contained in:
Trenton H
2026-03-19 10:05:07 -07:00
committed by GitHub
parent 2cbe6ae892
commit 68fc898042
5 changed files with 28 additions and 31 deletions
-9
View File
@@ -3,7 +3,6 @@ from unittest.mock import MagicMock
from unittest.mock import patch
import pytest
from django.conf import settings
from documents.models import Document
from paperless.models import LLMEmbeddingBackend
@@ -19,14 +18,6 @@ def mock_ai_config():
yield MockAIConfig
@pytest.fixture
def temp_llm_index_dir(tmp_path):
original_dir = settings.LLM_INDEX_DIR
settings.LLM_INDEX_DIR = tmp_path
yield tmp_path
settings.LLM_INDEX_DIR = original_dir
@pytest.fixture
def mock_document():
doc = MagicMock(spec=Document)