Summary
Our exploration of doctests for Django applications is now complete. In this chapter, we:
Began to develop some models for our Django
survey
applicationExperimented with adding doctests to one of these models—the
Survey
modelLearned what sorts of doctests are useful and which simply add clutter to the code
Experienced some of the advantages of doctests, namely the easy re-use of Python shell session work and convenient use of doctests as documentation
Ran afoul of many of the disadvantages of doctests, and learned how to avoid or overcome them
In the next chapter, we will begin to explore unit tests. While unit tests may not offer some of the easy re-use features of doctests, they also do not suffer from many of the disadvantages of doctests. Furthermore, the overall unit test framework allows Django to provide convenient support specifically useful for web applications, which will be covered in detail in Chapter 4.