Skip to content

Commit 6ee4e6b

Browse files
committed
renumber a few listings, try to fix .env
1 parent 4a3d0bf commit 6ee4e6b

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

chapter_19_mocking.asciidoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class SendLoginEmailViewTest(TestCase):
5454
self.assertRedirects(response, "/")
5555
----
5656
====
57-
//ch17l003
5857

5958

6059
Wire up the `include` in 'superlists/urls.py', plus the `url` in
@@ -74,7 +73,6 @@ def send_login_email(request):
7473
return redirect("/")
7574
----
7675
====
77-
//ch17l003
7876

7977

8078
I've added the import of the `send_mail` function as a placeholder for now:
@@ -1569,7 +1567,7 @@ Let's give `authenticate` the arguments it expects then:
15691567

15701568

15711569
[role="sourcecode"]
1572-
.src/accounts/views.py (ch17l040)
1570+
.src/accounts/views.py (ch19l040)
15731571
====
15741572
[source,python]
15751573
----
@@ -1655,7 +1653,7 @@ Let's try doing that. Deliberately wrong as usual first!
16551653

16561654

16571655
[role="sourcecode"]
1658-
.src/accounts/views.py (ch17l042)
1656+
.src/accounts/views.py (ch19l042)
16591657
====
16601658
[source,python]
16611659
----
@@ -1680,7 +1678,7 @@ AssertionError: call('ack!') != call(<WSGIRequest: GET
16801678
Let's fix that:
16811679

16821680
[role="sourcecode"]
1683-
.src/accounts/views.py (ch17l043)
1681+
.src/accounts/views.py (ch19l043)
16841682
====
16851683
[source,python]
16861684
----
@@ -1777,7 +1775,7 @@ And we get it passing like this:
17771775

17781776

17791777
[role="sourcecode"]
1780-
.src/accounts/views.py (ch17l045)
1778+
.src/accounts/views.py (ch19l045)
17811779
====
17821780
[source,python]
17831781
----
@@ -1943,7 +1941,7 @@ It's because of two things:
19431941
* Firstly, we need to re-add the email configuration to _settings.py_.
19441942

19451943
[role="sourcecode"]
1946-
.src/superlists/settings.py (ch17l049)
1944+
.src/superlists/settings.py (ch19l047)
19471945
====
19481946
[source,python]
19491947
----
@@ -1972,8 +1970,10 @@ to get a working login system without this one.
19721970
Just as we do on the server, you can also use a _.env_ file to save
19731971
project-specific environment variables:
19741972
1973+
[role="skip"]
19751974
[subs="specialcharacters,quotes"]
19761975
----
1976+
$ *echo .env >> .gitignore* # we don't want to commit our secrets into git!
19771977
$ *echo EMAIL_PASSWORD="yoursekritpasswordhere" >> .env*
19781978
$ *set -a; source .env; set +a;*
19791979
----
@@ -2039,7 +2039,7 @@ The last thing we need to do before we call it a day is to test the logout link
20392039
We extend the FT with a couple more steps:
20402040

20412041
[role="sourcecode"]
2042-
.src/functional_tests/test_login.py (ch17l050)
2042+
.src/functional_tests/test_login.py (ch19l048)
20432043
====
20442044
[source,python]
20452045
----
@@ -2076,7 +2076,7 @@ element: input[name=email]; [...]
20762076
So let's tell the base template that we want a new url named "logout":
20772077

20782078
[role="sourcecode small-code"]
2079-
.src/lists/templates/base.html (ch19l051)
2079+
.src/lists/templates/base.html (ch19l049)
20802080
====
20812081
[source,html]
20822082
----
@@ -2117,7 +2117,7 @@ https://docs.djangoproject.com/en/4.2/topics/auth/default/#module-django.contrib
21172117
which clears down the user's session and redirects them to a page of our choice:
21182118

21192119
[role="sourcecode small-code"]
2120-
.src/accounts/urls.py (ch19l052)
2120+
.src/accounts/urls.py (ch19l050)
21212121
====
21222122
[source,python]
21232123
----

0 commit comments

Comments
 (0)