Skip to content

Commit 24c4910

Browse files
committed
working incrementally chap done
1 parent b9bf187 commit 24c4910

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

chapter_working_incrementally.asciidoc

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ of our own code that caused the failure:
14341434
[subs="specialcharacters,macros"]
14351435
----
14361436
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"])
14381438
----
14391439

14401440
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
17541754
(functional_tests.tests.NewVisitorTest.test_can_start_a_list_for_one_user)
17551755
---------------------------------------------------------------------
17561756
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
17581758
test_can_start_a_list_for_one_user
17591759
self.wait_for_row_in_list_table("2: Use peacock feathers to make a fly")
17601760
[...]
@@ -2174,11 +2174,11 @@ Then we replace three lines in 'superlists/urls.py' with an `include`:
21742174
====
21752175
[source,python]
21762176
----
2177-
from django.urls import path
2177+
from django.urls import path, include
21782178
from lists import views as list_views
21792179
21802180
urlpatterns = [
2181-
path("", views.home_page, name="home"),
2181+
path("", list_views.home_page, name="home"),
21822182
path("lists/", include("lists.urls")),
21832183
]
21842184
----
@@ -2209,16 +2209,22 @@ from django.urls import path
22092209
from lists import views
22102210
22112211
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"),
22152215
]
22162216
----
22172217
====
22182218

22192219
Rerun the unit tests to check that everything worked.
22202220

22212221

2222+
----
2223+
Ran 9 tests in 0.040s
2224+
2225+
OK
2226+
----
2227+
22222228
When I did it, I couldn't quite believe I did it correctly on the first go. It
22232229
always pays to be skeptical of your own abilities, so I deliberately changed
22242230
one of the URLs slightly, just to check if it broke a test. It did. We're

0 commit comments

Comments
 (0)