diff --git a/chapter_20_mocking_1.asciidoc b/chapter_20_mocking_1.asciidoc index 3714835e..d3182af7 100644 --- a/chapter_20_mocking_1.asciidoc +++ b/chapter_20_mocking_1.asciidoc @@ -147,6 +147,7 @@ or what's sometimes called https://en.wikipedia.org/wiki/Monkey_patch[monkeypatc Let's suppose that, as a first step, we want to get to some code that invokes `send_mail` with the right subject line, from address, and to address. +// CSANAD: wouldn't "sender address" and "recipient address" sound better? That would look something like this: @@ -430,6 +431,7 @@ from django.test import TestCase ---- ==== +// CSANAD: using `self.assertTrue(mock_send_mail.called)` would be nicer. // SEBASTIAN: I'd give some hint (maybe visual?) that one should look at the decorator. // At first, I got lost as I was expecting something to change in the test itself, @@ -464,6 +466,9 @@ def send_login_email(request): [...] ---- ==== +// CSANAD: I suggest adding a bit of a text for the print: +// `print(f'DEBUG send_mail type:{type(send_mail)}')` +// it's arguably better practice and certainly easier for the eyes to find Let's run the tests again: @@ -559,6 +564,15 @@ to log in\nStart a new To-Do list' Submitting the email address currently has no effect, because the form isn't sending the data anywhere. +// CSANAD: It is sending the data! +// In the previous chapter at ch18l020 we set the form to +// `