Changeset 2314
- Timestamp:
- 12/28/06 07:13:14 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/turbogears/qstemplates/quickstart/+package+/tests/test_controllers.py_tmpl
r611 r2314 1 #if $identity != "none" 2 import turbogears 3 from nose import with_setup 4 #end if 1 5 from turbogears import testutil 2 6 from ${package}.controllers import Root 3 7 import cherrypy 8 9 #if $identity != "none" 10 def teardown_func(): 11 """Tests for apps using identity need to stop CP/TG after each test to 12 stop the VisitManager thread. See http://trac.turbogears.org/turbogears/ticket/1217 13 for details. 14 """ 15 turbogears.startup.stopTurboGears() 16 #end if 4 17 5 18 cherrypy.root = Root() … … 10 23 result = testutil.call(cherrypy.root.index) 11 24 assert type(result["now"]) == types.StringType 25 #if $identity != "none" 26 test_method = with_setup(teardown=teardown_func)(test_method) 27 #end if 12 28 13 29 def test_indextitle(): 14 "The mainpage should have the right title"30 "The indexpage should have the right title" 15 31 testutil.createRequest("/") 16 32 assert "<TITLE>Welcome to TurboGears</TITLE>" in cherrypy.response.body[0] 33 #if $identity != "none" 34 test_indextitle = with_setup(teardown=teardown_func)(test_indextitle) 35 #end if 36 37 #if $identity != "none" 38 def test_logintitle(): 39 "login page should have the right title" 40 testutil.createRequest("/login") 41 assert "<TITLE>Login</TITLE>" in cherrypy.response.body[0] 42 test_logintitle = with_setup(teardown=teardown_func)(test_logintitle) 43 #end if