Notes
Source: 📖 Test Driven Development with Python ch15 p274
View testing checklist
- Make sure to use the Django test client (see Testing template used for more info on the test client)
- Test that the template used is what you expect.
- Test each item in the view context dictionary.
- Test that each form (also accessed through the context dictionary) is the expected class.
- Test template logic—
for
and if
statements might deserve testing.
- Test both valid and invalid occurrences of POST requests.
- Test that forms are rendered and error messages displayed.