Code from Django 1.1 Testing and Debugging