Skip to content

Commit 39813d5

Browse files
committed
scratchpad elements
1 parent 74168af commit 39813d5

File tree

2 files changed

+48
-13
lines changed

2 files changed

+48
-13
lines changed

chapter_21_mocking_2.asciidoc

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,16 @@ and we'll also have a discussion about how many tests are "enough".
4444

4545
=== Using Our Auth Backend in the Login View
4646

47-
image::images/21in01.png[]
48-
47+
[role="scratchpad"]
48+
*****
49+
* _[strikethrough line-through]#Token model with email + uid#_
50+
* _[strikethrough line-through]#_view to create token + send login email incl. url w/ token uid#_
51+
* _[strikethrough line-through]#Custom user model with USERNAME_FIELD=email#_
52+
* _[strikethrough line-through]#Authentication backend with authenticate() and get_user() functions#_
53+
* _Register auth backend in settings.py_
54+
* _login view calls authenticate() and login() from django.contrib.auth_
55+
* _logout view calls django.contrib.auth.logout_
56+
*****
4957

5058
We got our auth backend ready in the last chapter,
5159
now we need use the backend in our login view.
@@ -68,8 +76,16 @@ AUTHENTICATION_BACKENDS = [
6876

6977
That was easy!
7078

71-
image::images/21in02.png[]
72-
79+
[role="scratchpad"]
80+
*****
81+
* _[strikethrough line-through]#Token model with email + uid#_
82+
* _[strikethrough line-through]#_view to create token + send login email incl. url w/ token uid#_
83+
* _[strikethrough line-through]#Custom user model with USERNAME_FIELD=email#_
84+
* _[strikethrough line-through]#Authentication backend with authenticate() and get_user() functions#_
85+
* _[strikethrough line-through]#Register auth backend in settings.py#_
86+
* _login view calls authenticate() and login() from django.contrib.auth_
87+
* _logout view calls django.contrib.auth.logout_
88+
*****
7389

7490
Next let's write some tests for what should happen in our view.
7591
Looking back at the spike again:
@@ -1438,9 +1454,16 @@ $ *git diff --staged*
14381454
$ *git commit -m "Custom passwordless auth backend + custom user model"*
14391455
----
14401456

1441-
1442-
image::images/21in03.png[]
1443-
1457+
[role="scratchpad"]
1458+
*****
1459+
* _[strikethrough line-through]#Token model with email + uid#_
1460+
* _[strikethrough line-through]#_view to create token + send login email incl. url w/ token uid#_
1461+
* _[strikethrough line-through]#Custom user model with USERNAME_FIELD=email#_
1462+
* _[strikethrough line-through]#Authentication backend with authenticate() and get_user() functions#_
1463+
* _[strikethrough line-through]#Register auth backend in settings.py#_
1464+
* _[strikethrough line-through]#login view calls authenticate() and login() from django.contrib.auth#_
1465+
* _logout view calls django.contrib.auth.logout_
1466+
*****
14441467

14451468

14461469
=== Finishing Off Our FT, Testing Logout
@@ -1579,8 +1602,16 @@ WARNING: We're nowhere near a truly secure or acceptable login system here.
15791602
// authentication, we could mention that after logout, we can log in using any
15801603
// of the previous login magic links (there is no token invalidation)
15811604

1582-
image::images/21in04.png[]
1583-
1605+
[role="scratchpad"]
1606+
*****
1607+
* _[strikethrough line-through]#Token model with email + uid#_
1608+
* _[strikethrough line-through]#_view to create token + send login email incl. url w/ token uid#_
1609+
* _[strikethrough line-through]#Custom user model with USERNAME_FIELD=email#_
1610+
* _[strikethrough line-through]#Authentication backend with authenticate() and get_user() functions#_
1611+
* _[strikethrough line-through]#Register auth backend in settings.py#_
1612+
* _[strikethrough line-through]#login view calls authenticate() and login() from django.contrib.auth#_
1613+
* _[strikethrough line-through]#logout view calls django.contrib.auth.logout#_
1614+
*****
15841615

15851616
In the next chapter, we'll start trying to put our login system to good use.
15861617
In the meantime, do a commit and enjoy this recap:

chapter_22_fixtures_and_wait_decorator.asciidoc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,10 @@ with the amount of duplication of `wait_for` stuff in here.
220220
Let's make a note to come back to it,
221221
and get these helpers working.
222222

223-
image::images/22in01.png[]
224-
223+
[role="scratchpad"]
224+
*****
225+
* 'Clean up wait_for stuff in base.py'
226+
*****
225227

226228

227229
First we use them in 'test_login.py':
@@ -555,7 +557,10 @@ OK
555557

556558
Do a commit, and we're good to cross of that scratchpad item:
557559

558-
image::images/22in02.png[]
560+
[role="scratchpad"]
561+
*****
562+
* '[strikethrough line-through]#Clean up wait_for stuff in base.py#'
563+
*****
559564

560565

561566
In the next chapter we'll try to deploy our code to staging,
@@ -568,7 +573,6 @@ As we'll see it'll help us catch a little bug or two!
568573

569574

570575

571-
572576
.Lessons Learned
573577
*******************************************************************************
574578

0 commit comments

Comments
 (0)