Code

Changes between Version 5 and Version 6 of TestingGuide


Ignore:
Timestamp:
02/10/09 05:55:18 (5 years ago)
Author:
nielsw
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TestingGuide

    v5 v6  
    44 
    55== Writing portable tests == 
     6 
     7=== tests should run in isolation === 
     8Whenever possible use test_urls and dedicated test templates to make sure your tests run as isolated. Usually you will want to write your test in such a way that they will only fail when there a failure in what you're testing. What you don't want is your unit tests failing because someone decided to put a bad template tag in your non-test template.  
     9 
     10If at all possible you should avoid using Django's test client, too. Why? Because it often introduces failures which are not related to your code (e.g. middleware). If you're going to do anything more complex than getting or setting a variable in Django, write a method class to do that and test it directly. 
    611 
    712=== test_urls ===