Code from Harry Percival's "Test-Driven Web Development With Python"