Skip to content

Commit d259362

Browse files
committed
update error message to match the text fixing the ValidationError
1 parent 1514a81 commit d259362

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

chapter_14_simple_form.asciidoc

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -645,33 +645,32 @@ Ran 17 tests in 0.126s
645645
OK
646646
----
647647

648-
And the functional tests too:
648+
And the functional tests too, where we can see three errors:
649649

650-
[subs="specialcharacters,macros"]
651650
----
652-
$ pass:quotes[*python src/manage.py test functional_tests*]
651+
ERROR: test_layout_and_styling (functional_tests.test_layout_and_styling.LayoutAndStylingTest.test_layout_and_styling)
653652
[...]
654-
File "...goat-book/src/functional_tests/test_layout_and_styling.py", line 27,
655-
in test_layout_and_styling
656-
inputbox = self.get_item_input_box()
657-
^^^^^^^^^^^^^^^^^^^^^^^^^
658-
File "...goat-book/src/functional_tests/base.py", line 45, in
659-
get_item_input_box
660-
return self.browser.find_element(By.ID, "id_text")
661-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
653+
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate
654+
element: [id="id_text"];
655+
[...]
656+
ERROR: test_can_start_a_todo_list (functional_tests.test_simple_list_creation.NewVisitorTest.test_can_start_a_todo_list)
662657
[...]
663658
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate
664-
element: [id="id_text"]; [...]
665-
659+
element: [id="id_text"];
666660
[...]
667-
FAILED (errors=3)
668661
----
669662

670-
Not quite! Let's look at where this is happening--if
671-
you check the line number from one of the failures,
672-
you'll see that each time after we've submitted a first item,
673-
the input box has disappeared from the lists page.
663+
and
664+
665+
----
666+
ERROR: test_cannot_add_empty_list_items (functional_tests.test_list_item_validation.ItemValidationTest.test_cannot_add_empty_list_items)
667+
[...]
668+
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate
669+
element: .invalid-feedback;
670+
[...]
671+
----
674672

673+
Let's start with the latter.
675674
Checking _views.py_ and the `new_list` view we can see
676675
it's because if we detect a validation error,
677676
we're not actually passing the form to the _home.html_ template:

0 commit comments

Comments
 (0)