mirror of
https://github.com/ae-utbm/sith.git
synced 2025-04-15 18:40:23 +00:00
Use assertRedirects for test_not_authorized
This commit is contained in:
parent
31575d0b64
commit
d8be9a62b5
@ -4,6 +4,7 @@ import pytest
|
||||
from django.test import Client
|
||||
from django.urls import reverse
|
||||
from model_bakery import baker
|
||||
from pytest_django.asserts import assertRedirects
|
||||
|
||||
from core.baker_recipes import subscriber_user
|
||||
from core.models import User
|
||||
@ -29,8 +30,10 @@ class TestBillingInfo:
|
||||
reverse("eboutic:billing_infos"),
|
||||
payload,
|
||||
)
|
||||
assert response.status_code == 302
|
||||
assert response["Location"].startswith(reverse("core:login"))
|
||||
assertRedirects(
|
||||
response,
|
||||
reverse("core:login", query={"next": reverse("eboutic:billing_infos")}),
|
||||
)
|
||||
|
||||
def test_edit_infos(self, client: Client, payload: dict[str, str]):
|
||||
user = subscriber_user.make()
|
||||
|
Loading…
x
Reference in New Issue
Block a user