fix: redirect root URL to task list
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
from django.test import TestCase
|
||||
from django.urls import reverse
|
||||
|
||||
# Create your tests here.
|
||||
class HomeRedirectTests(TestCase):
|
||||
def test_root_redirects_to_task_list(self):
|
||||
response = self.client.get("/")
|
||||
self.assertRedirects(response, reverse("task-list"), fetch_redirect_response=False)
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
from django.contrib.auth import views as auth_views
|
||||
from django.urls import path
|
||||
from django.views.generic import RedirectView
|
||||
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path("", RedirectView.as_view(pattern_name="task-list", permanent=False), name="home"),
|
||||
path("login/", auth_views.LoginView.as_view(template_name="accounts/login.html"), name="login"),
|
||||
path("logout/", auth_views.LogoutView.as_view(), name="logout"),
|
||||
path("password/change/", views.password_change, name="password-change"),
|
||||
|
||||
Reference in New Issue
Block a user