@@ -56,6 +56,10 @@ selenium.common.exceptions.NoSuchElementException: Message: Unable to locate
56
56
element: .invalid-feedback; For documentation [...]
57
57
----
58
58
59
+ // CSANAD: I don't have the "For documentation" here:
60
+ // Unable to locate element: .invalid-feedback
61
+ // I only have the stack trace.
62
+
59
63
It's expecting to see an error message if the user tries to input an empty
60
64
item.
61
65
@@ -131,6 +135,8 @@ except ValidationError:
131
135
132
136
But the `with` formulation is neater. Now, we can try running the test,
133
137
and see its expected failure:
138
+ // CSANAD: I would highlight we are running the unit test here
139
+ // python src/manage.py test lists
134
140
135
141
----
136
142
with self.assertRaises(ValidationError):
@@ -155,6 +161,7 @@ So why is the test still failing?
155
161
Well, for
156
162
http://bit.ly/2v3SfRq[slightly counterintuitive historical reasons],
157
163
Django models don't run full validation on save.
164
+ // CSANAD: I'd argue against the use of shortened URLs.
158
165
As we'll see later,
159
166
any constraints that are actually implemented in the database
160
167
will raise errors on save,
@@ -167,6 +174,9 @@ But Django knows that SQLite doesn't support this type of constraint,
167
174
so if we try to run `makemigrations`, it will report there's nothing to do:
168
175
169
176
177
+ // CSANAD: maybe I'm missing something here but I don't think there would have
178
+ // been any changes detected here even with another DB. I don't remember
179
+ // changing the model since the last migration.
170
180
[subs="specialcharacters,macros"]
171
181
----
172
182
$ pass:quotes[*python src/manage.py makemigrations*]
@@ -538,7 +548,9 @@ element: .invalid-feedback; [...]
538
548
----
539
549
540
550
541
- Not quite, but they did get a little further. Checking 'line 31', we can
551
+ Not quite, but they did get a little further. Checking the line in which the
552
+ error occurred -- 'line 31' in my case -- , we can
553
+ // CSANAD: I think emphasizing what to look for in the error log is helpful.
542
554
see that we've got past the first part of the test, and are now onto the second
543
555
check--that submitting a second empty item also shows an error.
544
556
0 commit comments