@@ -1434,7 +1434,7 @@ of our own code that caused the failure:
1434
1434
[subs="specialcharacters,macros"]
1435
1435
----
1436
1436
File "...python-tdd-book/lists/views.py", line 10, in new_list
1437
- Item.objects.create(text=request.POST[' item_text' ])
1437
+ Item.objects.create(text=request.POST[" item_text" ])
1438
1438
----
1439
1439
1440
1440
It's when we try to create an item without a parent list. So we make a similar
@@ -1754,7 +1754,7 @@ FAIL: test_can_start_a_list_for_one_user
1754
1754
(functional_tests.tests.NewVisitorTest.test_can_start_a_list_for_one_user)
1755
1755
---------------------------------------------------------------------
1756
1756
Traceback (most recent call last):
1757
- File "...python-tdd-book/functional_tests/tests.py", line 68 , in
1757
+ File "...python-tdd-book/functional_tests/tests.py", line 63 , in
1758
1758
test_can_start_a_list_for_one_user
1759
1759
self.wait_for_row_in_list_table("2: Use peacock feathers to make a fly")
1760
1760
[...]
@@ -2174,11 +2174,11 @@ Then we replace three lines in 'superlists/urls.py' with an `include`:
2174
2174
====
2175
2175
[source,python]
2176
2176
----
2177
- from django.urls import path
2177
+ from django.urls import path, include
2178
2178
from lists import views as list_views
2179
2179
2180
2180
urlpatterns = [
2181
- path("", views .home_page, name="home"),
2181
+ path("", list_views .home_page, name="home"),
2182
2182
path("lists/", include("lists.urls")),
2183
2183
]
2184
2184
----
@@ -2209,16 +2209,22 @@ from django.urls import path
2209
2209
from lists import views
2210
2210
2211
2211
urlpatterns = [
2212
- path("lists/ new", views.new_list, name="new_list"),
2213
- path("lists/ <int:list_id>/", views.view_list, name="view_list"),
2214
- path("lists/ <int:list_id>/add_item", views.add_item, name="add_item"),
2212
+ path("new", views.new_list, name="new_list"),
2213
+ path("<int:list_id>/", views.view_list, name="view_list"),
2214
+ path("<int:list_id>/add_item", views.add_item, name="add_item"),
2215
2215
]
2216
2216
----
2217
2217
====
2218
2218
2219
2219
Rerun the unit tests to check that everything worked.
2220
2220
2221
2221
2222
+ ----
2223
+ Ran 9 tests in 0.040s
2224
+
2225
+ OK
2226
+ ----
2227
+
2222
2228
When I did it, I couldn't quite believe I did it correctly on the first go. It
2223
2229
always pays to be skeptical of your own abilities, so I deliberately changed
2224
2230
one of the URLs slightly, just to check if it broke a test. It did. We're
0 commit comments