Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Good stuff. I like the way you gradually introduce the idea of a form here.
Reviewing this chapter prompted a couple of more general thoughts.
Functional tests
The Selenium-based functional testing approach involves tradeoffs. For me, the lower-level Django test client (or, even better django-webtest) is a sweeter spot for functional testing. I appreciate we use these in test_views, but they're not really unit tests. I'm not sure whether you get to it later in the book, but I think it would be worthwhile discussing the different options so people don't feel like they absolutely have to use Selenium to have decently tested web applications.
And, more generally - we can't test everything, right? So it's about judging the tradeoffs. I think the readers should feel empowered to see that this is just one way but they should keep reflecting on whether it's a way that works for them. My tests for Django look very different to the ones in this book - both the unit and the functional tests.
Keeping the test suite passing
One of the best things I've taken from our recent TDD dojos is the idea of keeping the test suite passing during refactors, even to the point of doing apparently counter-intuitive things such as copy-pasting code. In this chapter we have the test suite failing for quite a while (even to the point where we're making git commits while the suite is failing).
+
in tips at endRe. the stray
+
, here's a screenshot of how it appears to me locally. Maybe it's a problem with how I'm building it though.