Skip to content

Commit 2239e5c

Browse files
committed
address chapter13 update review comments
move commit, add TIP. Also, fix code listing and spacing. Make 'broken code listing id-s' an Issue on GitHub
1 parent 0b7c2b6 commit 2239e5c

File tree

1 file changed

+31
-21
lines changed

1 file changed

+31
-21
lines changed

chapter_13_database_layer_validation.asciidoc

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -580,13 +580,28 @@ Not quite, but they did get a little further. Checking the line in which the
580580
error occurred -- 'line 31' in my case -- , we can
581581
// CSANAD: I think emphasizing what to look for in the error log is helpful.
582582
see that we've got past the first part of the test, and are now onto the second
583-
check--that submitting a second empty item also shows an error.
583+
check -- that submitting a second empty item also shows an error.
584584

585585
((("", startref="MLVsurfac13")))We've
586-
got some working code though, so let's put an early return in the FT to separate
586+
got some working code though, so let's have a commit:
587+
588+
589+
[subs="specialcharacters,quotes"]
590+
----
591+
$ *git commit -am "Adjust new list view to do model validation"*
592+
----
593+
594+
595+
TIP: When working on a new feature, it's common to realize partway through that
596+
a refactor of the application is needed. Adding an early return to the FT
597+
you're currently working on allows you to perform this refactor against
598+
passing FTs, even while the feature is still in progress.
599+
600+
601+
Let's put an early return in the FT to separate
587602
what we got working from those that still need to be dealt with:
603+
588604
[role="sourcecode"]
589-
// TODO fix code listing reference number
590605
.src/functional_tests/test_list_item_validation.py (ch13l???)
591606
====
592607
[source,python]
@@ -603,6 +618,7 @@ class ItemValidationTest(FunctionalTest):
603618
# Perversely, she now decides to submit a second blank list item
604619
self.browser.find_element(By.ID, "id_new_item").send_keys(Keys.ENTER)
605620
[...]
621+
----
606622
====
607623

608624

@@ -615,16 +631,7 @@ We should also remind ourselves not to forget to remove this early return:
615631
* 'Remove the early return from the FT'
616632
*****
617633

618-
...and it's time to commit our changes:
619-
620-
621-
[subs="specialcharacters,quotes"]
622-
----
623-
$ *git commit -am "Adjust new list view to do model validation"*
624-
----
625-
626-
627-
634+
And now, we can focus on making our code a little neater.
628635

629636

630637
=== Django Pattern: Processing POST Requests in the Same View as Renders the Form
@@ -831,7 +838,17 @@ OK
831838
----
832839

833840

834-
Let's try a full FT run: they're all passing! We can remove the early return
841+
Let's try a full FT run: they're all passing!
842+
Our refactor of the `add_item` functionality is complete.
843+
We should commit there:
844+
845+
[subs="specialcharacters,quotes"]
846+
----
847+
$ *git commit -am "Refactor list view to handle new item POSTs"*
848+
----
849+
850+
851+
We can remove the early return
835852
now.
836853

837854
[role="scratchpad"]
@@ -857,13 +874,6 @@ FAILED (errors=1)
857874
----
858875

859876
We're back to the one failure in our new functional test.
860-
Our refactor of the `add_item` functionality is complete.
861-
We should commit there:
862-
863-
[subs="specialcharacters,quotes"]
864-
----
865-
$ *git commit -am "Refactor list view to handle new item POSTs"*
866-
----
867877

868878

869879

0 commit comments

Comments
 (0)