mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-05-04 21:55:25 +00:00
Some little fixes around factories
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user