Skip to content

Commit

Permalink
test: backend - user views
Browse files Browse the repository at this point in the history
registration view, login view
  • Loading branch information
rkshaon committed Aug 3, 2024
1 parent 67bc96f commit 5dae30c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions backend/user_api/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from django.urls import resolve, reverse
from django.test import TestCase
from django.test import SimpleTestCase

from user_api.models import User

from user_api.views import v1 as v1_views


class UserModelTestCase(TestCase):
def setUp(self):
Expand Down Expand Up @@ -32,3 +37,14 @@ def test_superuser_creation(self):
self.assertTrue(superuser.is_active)
self.assertTrue(superuser.is_staff)
self.assertTrue(superuser.is_superuser)


class UrlsTestCase(SimpleTestCase):
def test_user_registration_url_resolves(self):
url = reverse('user-registration')
self.assertEqual(resolve(url).func.view_class,
v1_views.UserRegistrationView)

def test_user_login_url_resolves(self):
url = reverse('user-login')
self.assertEqual(resolve(url).func.view_class, v1_views.UserLoginView)

0 comments on commit 5dae30c

Please sign in to comment.