Changeset 2315

Show
Ignore:
Timestamp:
12/28/06 07:16:52 (2 years ago)
Author:
alberto
Message:

Manually merging 2313:2314 from 1.0

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/turbogears/qstemplates/quickstart/+package+/tests/test_controllers.py_tmpl

    r2264 r2315  
     1#if $identity != "none" 
     2import turbogears 
     3from nose import with_setup 
     4#end if 
    15from turbogears import testutil 
    26from ${package}.controllers import Root 
    37import cherrypy 
     8 
     9#if $identity != "none" 
     10def 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 
    417 
    518cherrypy.root = Root() 
     
    1023    result = testutil.call(cherrypy.root.index) 
    1124    assert type(result["now"]) == types.StringType 
     25#if $identity != "none" 
     26test_method = with_setup(teardown=teardown_func)(test_method) 
     27#end if 
    1228 
    1329def test_indextitle(): 
    14     "The mainpage should have the right title" 
     30    "The indexpage should have the right title" 
    1531    testutil.createRequest("/") 
    1632    assert "<title>Welcome to TurboGears</title>" in cherrypy.response.body[0] 
     33#if $identity != "none" 
     34test_indextitle = with_setup(teardown=teardown_func)(test_indextitle) 
     35#end if 
     36 
     37#if $identity != "none" 
     38def test_logintitle(): 
     39    "login page should have the right title" 
     40    testutil.createRequest("/login") 
     41    assert "<title>Login</title>" in cherrypy.response.body[0] 
     42test_logintitle = with_setup(teardown=teardown_func)(test_logintitle) 
     43#end if