diff options
Diffstat (limited to 'ctrack/users/tests/test_urls.py')
-rw-r--r-- | ctrack/users/tests/test_urls.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ctrack/users/tests/test_urls.py b/ctrack/users/tests/test_urls.py new file mode 100644 index 0000000..383a649 --- /dev/null +++ b/ctrack/users/tests/test_urls.py @@ -0,0 +1,24 @@ +import pytest +from django.urls import reverse, resolve + +from ctrack.users.models import User + +pytestmark = pytest.mark.django_db + + +def test_detail(user: User): + assert ( + reverse("users:detail", kwargs={"username": user.username}) + == f"/users/{user.username}/" + ) + assert resolve(f"/users/{user.username}/").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" |