Skip to content

Commit 750a121

Browse files
committed
Merge remote-tracking branch 'atlas/main'
2 parents 84b767d + 0ee61ed commit 750a121

27 files changed

+64
-78
lines changed

acknowledgments.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Tom Nguyen,
133133
rokbot,
134134
Nikita Durne,
135135
and to anyone I've missed off this list,
136-
my sincere apologies, ping me and i'll add you,
136+
my sincere apologies, ping me and I'll add you,
137137
and thank you thank you once again.
138138

139139

appendix_X_what_to_do_next.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ so if the other person adds an item to the list, you see it immediately?
106106
A persistent connection between client and server using websockets
107107
is the way to get this to work.
108108

109-
Check out Django's aysnc features see if you can them to implement dynamic notifications.
109+
Check out Django's async features and see if you can use them to implement dynamic notifications.
110110

111111
To test it, you'll need two browser instances
112112
(like we used for the list sharing tests),

appendix_purist_unit_tests.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ we can do better.
877877
Keep Listening to Your Tests: Removing ORM Code from Our Application
878878
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
879879

880-
((("Object-Relational Mapper (ORM)")))Again, these tests are trying to tell us something: the Django ORM
880+
((("object-relational mapper (ORM)")))Again, these tests are trying to tell us something: the Django ORM
881881
is hard to mock out, and our form class needs to know too much about
882882
how it works. Programming by wishful thinking again, what would
883883
be a simpler API that our form could use? How about something like
@@ -2077,7 +2077,7 @@ the most hard work
20772077
20782078
20792079
Decoupling our application from ORM code::
2080-
((("Object-Relational Mapper (ORM)")))One
2080+
((("object-relational mapper (ORM)")))One
20812081
of the consequences of striving to write isolated tests is that we
20822082
find ourselves forced to remove ORM code from places like views and forms,
20832083
by hiding it behind helper functions or methods. This can be beneficial in

atlas.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
],
5353
"formats": {
5454
"pdf": {
55-
"version": "web",
55+
"version": "print",
5656
"toc": true,
5757
"index": true,
5858
"antennahouse_version": "AHFormatterV71_64-MR2",

chapter_03_unit_test_first_view.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ the `-m` flag lets you pass in a commit message at the command line,
257257
so you don't need to use an editor.
258258
It's up to you to pick the way you like to use the Git command line;
259259
I'll just show you the main ones I've seen used.
260-
For me, the main big of VCS hygiene is:
260+
For me, the key rule of VCS hygiene is:
261261
_make sure you always review what you're about to commit before you do it_.
262262

263263
[[django-mvc]]

chapter_04_philosophy_and_refactoring.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Does all this stuff really have value? Is this a bit of a cargo cult?
3232

3333

3434

35-
=== Programming Is Like Pulling a Bucket of Water Up [keep-together]#from a Well#
35+
=== Programming Is Like Pulling a Bucket of Water [.keep-together]#Up from a Well#
3636

3737
((("Test-Driven Development (TDD)", "philosophy of", "bucket of water analogy")))
3838
Ultimately, programming is hard. Often, we are smart, so we succeed.
@@ -68,7 +68,7 @@ need to be a bit bloody-minded about it.
6868
.On the Merits of Trivial Tests for Trivial Functions
6969
**********************************************************************
7070
In the short term, it may feel a bit silly to write tests for simple
71-
functions and [keep-together]#constants#.
71+
functions and [.keep-together]#constants#.
7272
7373
It's perfectly possible to imagine still doing ``mostly'' TDD,
7474
but following more relaxed rules where you don't unit test _absolutely_ everything.
@@ -299,7 +299,7 @@ $ *git commit -am "Functional test now checks we can input a to-do item"*
299299

300300

301301

302-
=== The "Don't Test Constants" Rule, and Templates to the Rescue
302+
=== The "Don't Test Constants" Rule, and Templates [.keep-together]#to the Rescue#
303303

304304

305305
((("“Don’t Test Constants” rule", primary-sortas="Don’t Test Constants rule")))

chapter_05_post_and_database.asciidoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ Now we get to the `self.fail('Finish the test!')`.
797797
If we get rid of that and finish writing our FT,
798798
to add the check for adding a second item to the table
799799
(copy and paste is our friend),
800-
we begin to see that our first cut solution really isn't going to, um, cut it:
800+
we begin to see that our first cut solution really isn't going to, um, [.keep-together]#cut it#:
801801

802802
[role="sourcecode"]
803803
.functional_tests.py (ch05l017)
@@ -965,10 +965,10 @@ and databases are a stalwart solution in this area.
965965
[[django_ORM_first_model]]
966966
=== The Django ORM and Our First Model
967967

968-
((("Object-Relational Mapper (ORM)", id="orm05")))
969-
((("Django framework", "Object-Relational Mapper (ORM)", id="DJForm05")))
970-
((("database testing", "Object-Relational Mapper (ORM)", id="DBTorm05")))
971-
An Object-Relational Mapper (ORM) is a layer of abstraction for data stored in a database
968+
((("object-relational mapper (ORM)", id="orm05")))
969+
((("Django framework", "object-relational mapper (ORM)", id="DJForm05")))
970+
((("database testing", "object-relational mapper (ORM)", id="DBTorm05")))
971+
An object-relational mapper (ORM) is a layer of abstraction for data stored in a database
972972
with tables, rows, and columns.
973973
It lets us work with databases using familiar object-oriented metaphors that work well with code.
974974
Classes map to database tables, attributes map to columns,
@@ -1384,7 +1384,7 @@ If you wanted to write our tests in a way that stays at the HTTP level—that tr
13841384
by sending more than one:
13851385
13861386
[role="sourcecode skipme"]
1387-
.lists/tests/test_views.py
1387+
.lists/tests/tests.py
13881388
====
13891389
[source,python]
13901390
----
@@ -1731,7 +1731,7 @@ def home_page(request):
17311731
====
17321732

17331733
[role="pagebreak-before less_space"]
1734-
=== Better Unit Testing Practice: Each Test Should Test One Thing
1734+
=== Better Unit Testing Practice: Each Test Should Test [.keep-together]#One Thing#
17351735

17361736
((("unit tests", "testing only one thing")))
17371737
((("testing best practices")))((("POST requests", "POST test is too long code smell, addressing")))
@@ -2146,7 +2146,7 @@ Where are we? How is progress on our app, and what have we learned?
21462146
But we've got a couple of items on our own to-do list,
21472147
namely getting the FT to clean up after itself,
21482148
and perhaps more critically,
2149-
adding support for more than one list.
2149+
adding support for more than one list:
21502150

21512151
[role="scratchpad"]
21522152
*****

chapter_06_explicit_waits_1.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let's take care of a couple of housekeeping items.
66
At the end of the last chapter, we made a note
77
that different test runs were interfering with each other, so we'll fix that.
88
I'm also not happy with all these ++time.sleep++s peppered through the code;
9-
they seem a bit unscientific, so we'll replace them with something more reliable.
9+
they seem a bit unscientific, so we'll replace them with something more reliable:
1010

1111
[role="scratchpad"]
1212
*****
@@ -55,7 +55,7 @@ _manage.py_, which will run tests from any files whose name begins with _test__.
5555
To keep things neat and tidy, let's make a folder for our FTs,
5656
so that it looks a bit like an app.
5757
All Django needs is for it to be a valid Python package directory
58-
(i.e., one with a +++<i>___init___.py</i>+++ in it):
58+
(i.e., one with a +++<i>___init___.py</i>+++ [.keep-together]#in it#):
5959

6060
[subs=""]
6161
----

chapter_07_working_incrementally.asciidoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ TIP: Watch out for trailing slashes in URLs,
471471
They're a common source of confusion:
472472
Django will return a 301 redirect rather than a 404
473473
if you try to access a URL that's missing its trailing slash.footnote:[
474-
The setting that controls this is called https://docs.djangoproject.com/en/5.2/ref/settings/#append-slash[APPEND_SLASH].
474+
The setting that controls this is called https://docs.djangoproject.com/en/5.2/ref/settings/#append-slash[`APPEND_SLASH`].
475475
]
476476
((("troubleshooting", "URL mappings")))
477477

@@ -684,7 +684,7 @@ OK
684684
----
685685

686686

687-
==== The FTs detect a regression
687+
==== The FTs Detect a Regression
688688

689689
As always when we get to passing unit tests,
690690
we run the FTs to check how things are doing
@@ -790,7 +790,7 @@ the way down to line 62 in the first FT,
790790
so we've at least added a first item.
791791
And our unit tests are all passing,
792792
so we're pretty sure the URLs and views that we _do_ have are doing what they should.
793-
Let's have a quick look at those unit tests to see what they tell us:
793+
Let's have a quick look at those unit tests to see what they [.keep-together]#tell us#:
794794

795795

796796
[subs="specialcharacters,quotes"]
@@ -980,7 +980,7 @@ It feels like the responsibilities of our two views are a little tangled up.
980980
Let's try and disentangle them.
981981

982982
[role="pagebreak-before less_space"]
983-
=== Another Small Step: A Separate Template for Viewing Lists
983+
=== Another Small Step: A Separate Template [.keep-together]#for Viewing Lists#
984984

985985
((("multiple lists testing", "separate list viewing templates", id="MLTseparate07")))
986986
((("templates", "separate list viewing templates", id="TMPseparate07")))

chapter_08_prettification.asciidoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ AssertionError: 102.5 != 512 within 10 delta (409.5 difference)
741741
That's because, although `runserver` automagically finds static files,
742742
+Live&#x2060;S&#x2060;e&#x2060;r&#x2060;v&#x2060;e&#x2060;r&#x200b;T&#x2060;e&#x2060;s&#x2060;t&#x2060;Case+ doesn't.
743743
Never fear, though:
744-
the Django developers have made an even more magical test class
744+
the Django developers have made an even [.keep-together]#more magical# test class
745745
called `StaticLiveServerTestCase`
746746
(see https://oreil.ly/mh-iO[the docs]).
747747

@@ -955,7 +955,8 @@ That's it! Definitely time for a commit:
955955

956956
[subs="specialcharacters,quotes"]
957957
----
958-
$ *git status* # changes tests.py, base.html, list.html, settings.py, + untracked lists/static
958+
$ *git status* # changes tests.py, base.html, list.html, settings.py,
959+
# and untracked lists/static
959960
$ *git add .*
960961
$ *git status* # will now show all the bootstrap additions
961962
$ *git commit -m "Use Bootstrap to improve layout"*
@@ -1057,7 +1058,7 @@ class HomePageTest(TestCase):
10571058

10581059
<2> Here's where we use a CSS selector to find our form,
10591060
implicitly also checking that it has `method="POST"`.
1060-
The `cssselect()` method returns a list matching elements.
1061+
The `cssselect()` method returns a list of matching elements.
10611062

10621063
<3> The `[form] =` is worth a mention.
10631064
What we're using here is a special assignment syntax called "unpacking",

0 commit comments

Comments
 (0)