• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Step 3: Writing Tests

Writing tests for global utilities is usually fairly simple because you usually do not have to start up the component architecture. In this case, however, you have to do so because you are looking up a view when asking for the root URL. You also have to register this view (absolute_url) in the first place, so it can be found later.

You need to create a package called tests, which should include the __init__.py file. In the tests package you should create a file called test_doc.py, where you insert the following setup and tear-down:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint