Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Django 1.1 Testing and Debugging

You're reading from   Django 1.1 Testing and Debugging Building rigorously tested and bug-free Django applications

Arrow left icon
Product type Paperback
Published in Apr 2010
Publisher Packt
ISBN-13 9781847197566
Length 436 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (17) Chapters Close

Django 1.1 Testing and Debugging
Credits
About the Author
About the Reviewer
Preface
1. Django Testing Overview FREE CHAPTER 2. Does This Code Work? Doctests in Depth 3. Testing 1, 2, 3: Basic Unit Testing 4. Getting Fancier: Django Unit Test Extensions 5. Filling in the Blanks: Integrating Django and Other Test Tools 6. Django Debugging Overview 7. When the Wheels Fall Off: Understanding a Django Debug Page 8. When Problems Hide: Getting More Information 9. When You Don't Even Know What to Log: Using Debuggers 10. When All Else Fails: Getting Outside Help 11. When it's Time to Go Live: Moving to Production Index

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 ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image