Package turbogears :: Module testutil :: Class TGTest

Class TGTest

source code

unittest.TestCase --+
                    |
                   TGTest

A WebTest enabled unit testing class.

To use, subclass & set root to your controller object, or set app to a webtest.TestApp instance.

In your tests, use self.app to make WebTest calls.

Instance Methods
 
setUp(self)
Set up the WebTest by starting the server.
source code
 
tearDown(self)
Tear down the WebTest by stopping the server.
source code
 
login_user(self, user)
Log a specified user object into the system.
source code
Class Variables
  root = None
hash(x)
  app = None
hash(x)
  stop_tg_only = False
hash(x)
  config = None
hash(x)
Method Details

setUp(self)

source code 

Set up the WebTest by starting the server.

You should override this and make sure you have properly mounted a root for your server before calling super, or simply pass a root controller to super. Otherwise the CherryPy filters for TurboGears will not be used.