Some little fixes around factories

This commit is contained in:
stumpylog
2026-04-30 15:21:40 -07:00
parent a204f7986c
commit a049174e86
3 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -12,6 +12,7 @@ from pytest_django.fixtures import SettingsWrapper
from rest_framework.test import APIClient
from documents.tests.factories import DocumentFactory
from documents.tests.factories import UserFactory
UserModelT = get_user_model()
@@ -129,9 +130,9 @@ def rest_api_client():
@pytest.fixture()
def regular_user(django_user_model: type[UserModelT]) -> UserModelT:
def regular_user(db) -> UserModelT:
"""Unprivileged authenticated user for permission boundary tests."""
return django_user_model.objects.create_user(username="regular", password="regular")
return UserFactory.create()
@pytest.fixture()
+1 -1
View File
@@ -35,7 +35,7 @@ def user_admin() -> PaperlessUserAdmin:
@pytest.fixture
def staff_user(db) -> User:
return UserFactory.create(username="staff", staff=True)
return UserFactory.create(staff=True)
class TestDocumentAdmin(DirectoriesMixin, TestCase):
+1 -1
View File
@@ -649,7 +649,7 @@ class TestDocumentConsumptionFinishedSignal:
assert doc_with_keyword.correspondent == correspondent
def test_correspondent_not_applied(self, doc_with_keyword: Document) -> None:
TagFactory.create(
CorrespondentFactory.create(
match="no-match",
matching_algorithm=MatchingModel.MATCH_ANY,
)