aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/users/tests/test_urls.py
blob: e5bdc25e0b7a0c4826f7fbfc2e3ceb7c582625b1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from django.urls import resolve
from django.urls import reverse

from pyblackbird_cc.users.models import User


def test_detail(user: User):
    assert reverse("users:detail", kwargs={"pk": user.pk}) == f"/users/{user.pk}/"
    assert resolve(f"/users/{user.pk}/").view_name == "users:detail"


def test_update():
    assert reverse("users:update") == "/users/~update/"
    assert resolve("/users/~update/").view_name == "users:update"


def test_redirect():
    assert reverse("users:redirect") == "/users/~redirect/"
    assert resolve("/users/~redirect/").view_name == "users:redirect"