Chore: Share the API client fixtures and build test users cheaply (#14199)

This commit is contained in:
Trenton H authored and GitHub committed 2026-09-21 10:57:14 -07:00
1 parent 2d955e9697
commit 99ce6b5db3
44 files changed
+442 -477

No files matched your search

+3 -5
View File
@@ -1,12 +1,13 @@
import uuid
from django.contrib.auth.models import User
from django.test import TestCase
from django.test import override_settings
from django.urls import resolve
from django.urls import reverse
from rest_framework import status
from paperless_testing.factories import UserFactory
class TestApiAuthViews(TestCase):
def test_api_auth_login_uses_allauth_login_view(self):
@@ -24,10 +25,7 @@ class TestApiAuthViews(TestCase):
@override_settings(DISABLE_REGULAR_LOGIN=True)
def test_api_auth_login_respects_disable_regular_login(self):
username = f"testuser-{uuid.uuid4().hex}"
User.objects.create_user(
username=username,
password="testpassword",
)
UserFactory(username=username, password="testpassword")
response = self.client.post(
reverse("rest_framework:login"),