Organizing tests
Before we set out to write code (and tests) for serving web pages from the survey application, let's consider the tests we have so far. If we run manage.py test survey -v2
and examine the tail end of the output, we can see that we've already accumulated over a dozen individual tests:
No fixtures found. testClearWinner (survey.tests.QuestionWinningAnswersTest) ... ok testNoAnswers (survey.tests.QuestionWinningAnswersTest) ... ok testNoResponses (survey.tests.QuestionWinningAnswersTest) ... ok testTwoWayTie (survey.tests.QuestionWinningAnswersTest) ... ok testActive (survey.tests.SurveyManagerTest) ... ok testCompleted (survey.tests.SurveyManagerTest) ... ok testUpcoming (survey.tests.SurveyManagerTest) ... ok Verify closes is autoset correctly ... ok Verify closes is honored if specified ... ok Verify closes is only autoset during initial create ... ok Verify correct exception is raised in error case ... ok testUnicode (survey.tests.SurveyUnicodeTest) ... ok ...