O'Reilly logo

Django 1.1 Testing and Debugging by Karen M. Tracey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Testing 1, 2, 3: Basic Unit Testing

In the previous chapter, we began learning about testing Django applications by writing some doctests for the Survey model. In the process, we experienced some of the advantages and disadvantages of doctests. When discussing some of the disadvantages, unit tests were mentioned as an alternative test approach that avoids some doctest pitfalls. In this chapter, we will start to learn about unit tests in detail. Specifically, we will:

  • Re-implement the Survey doctests as unit tests
  • Assess how the equivalent unit test version compares to the doctests in terms of ease of implementation and susceptibility to the doctest caveats discussed in the previous chapter
  • Begin learning some of the additional capabilities ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required