Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review of chapter 20 #340

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions chapter_20_mocking_1.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ class SendLoginEmailViewTest(TestCase):
----
====

// SEBASTIAN: I really like this way of introducing [monkey]patching in tests, congrats

<1> We define a `fake_send_mail` function,
which looks like the real `send_mail` function,
but all it does is save some information about how it was called,
Expand Down Expand Up @@ -429,6 +431,9 @@ from django.test import TestCase
----
====

// 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,
// for example mock.patch used as context manager.

If you rerun the tests, you'll see they still pass.
And since we're always suspicious of any test that still passes after a big change,
Expand Down
Loading