Add an integration test

This should cover the problem raised for webpack loader issues
This commit is contained in:
Bruno Alla 2023-02-03 19:00:28 +00:00
parent 76a987ac56
commit 826712d2b3
No known key found for this signature in database

View File

@ -6,6 +6,7 @@ from django.contrib.messages.middleware import MessageMiddleware
from django.contrib.sessions.middleware import SessionMiddleware
from django.http import HttpRequest, HttpResponseRedirect
from django.test import RequestFactory
from django.test.client import Client
from django.urls import reverse
from {{ cookiecutter.project_slug }}.users.forms import UserAdminChangeForm
@ -91,6 +92,13 @@ class TestUserDetailView:
assert response.status_code == 200
def test_authenticated_integration(self, user: User, client: Client):
client.force_login(UserFactory())
response = client.get(
reverse("users:detail", kwargs={"username": user.username})
)
assert response.status_code == 200
def test_not_authenticated(self, user: User, rf: RequestFactory):
request = rf.get("/fake-url/")
request.user = AnonymousUser()