phase8: expand test coverage and refine docs with gitflow milestones
This commit is contained in:
@ -21,3 +21,20 @@ def test_dashboard_requires_authentication(client):
|
||||
response = client.get(reverse("core:dashboard"))
|
||||
assert response.status_code == 302
|
||||
assert reverse("users:login") in response.url
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_login_logout_flow(client):
|
||||
User.objects.create_user(username="login-user", email="login@example.com", password="StrongPass12345")
|
||||
|
||||
login_response = client.post(
|
||||
reverse("users:login"),
|
||||
data={"username": "login-user", "password": "StrongPass12345"},
|
||||
follow=True,
|
||||
)
|
||||
assert login_response.status_code == 200
|
||||
assert login_response.wsgi_request.user.is_authenticated
|
||||
|
||||
logout_response = client.post(reverse("users:logout"), follow=True)
|
||||
assert logout_response.status_code == 200
|
||||
assert not logout_response.wsgi_request.user.is_authenticated
|
||||
|
||||
Reference in New Issue
Block a user