Spaces:
Sleeping
Sleeping
Commit ·
02c72d1
1
Parent(s): bb76786
url config, map / to home_page view
Browse files- lists/tests.py +4 -6
- superlists/urls.py +4 -4
lists/tests.py
CHANGED
|
@@ -5,9 +5,7 @@ from lists.views import home_page
|
|
| 5 |
|
| 6 |
class HomePageTest(TestCase):
|
| 7 |
def test_home_page_returns_correct_html(self):
|
| 8 |
-
|
| 9 |
-
response
|
| 10 |
-
|
| 11 |
-
self.
|
| 12 |
-
self.assertTrue(html.startswith("<html>"))
|
| 13 |
-
self.assertTrue(html.endswith("</html>"))
|
|
|
|
| 5 |
|
| 6 |
class HomePageTest(TestCase):
|
| 7 |
def test_home_page_returns_correct_html(self):
|
| 8 |
+
response = self.client.get("/")
|
| 9 |
+
self.assertContains(response, "<title>To-Do lists</title>")
|
| 10 |
+
self.assertContains(response, "<html>")
|
| 11 |
+
self.assertContains(response, "</html>")
|
|
|
|
|
|
superlists/urls.py
CHANGED
|
@@ -14,9 +14,9 @@ Including another URLconf
|
|
| 14 |
1. Import the include() function: from django.urls import include, path
|
| 15 |
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
| 16 |
"""
|
| 17 |
-
from django.
|
| 18 |
-
from
|
| 19 |
|
| 20 |
urlpatterns = [
|
| 21 |
-
path(
|
| 22 |
-
]
|
|
|
|
| 14 |
1. Import the include() function: from django.urls import include, path
|
| 15 |
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
| 16 |
"""
|
| 17 |
+
from django.urls import path
|
| 18 |
+
from lists.views import home_page
|
| 19 |
|
| 20 |
urlpatterns = [
|
| 21 |
+
path("", home_page, name="home"),
|
| 22 |
+
]
|