2 from nose import with_setup
3 from turbogears import testutil
4 from sercom.controllers import Root
8 """Tests for apps using identity need to stop CP/TG after each test to
9 stop the VisitManager thread. See http://trac.turbogears.org/turbogears/ticket/1217
12 turbogears.startup.stopTurboGears()
14 cherrypy.root = Root()
17 "the index method should return a string called now"
19 result = testutil.call(cherrypy.root.index)
20 assert type(result["now"]) == types.StringType
21 test_method = with_setup(teardown=teardown_func)(test_method)
23 def test_indextitle():
24 "The indexpage should have the right title"
25 testutil.createRequest("/")
26 assert "<TITLE>Welcome to TurboGears</TITLE>" in cherrypy.response.body[0]
27 test_indextitle = with_setup(teardown=teardown_func)(test_indextitle)
29 def test_logintitle():
30 "login page should have the right title"
31 testutil.createRequest("/login")
32 assert "<TITLE>Login</TITLE>" in cherrypy.response.body[0]
33 test_logintitle = with_setup(teardown=teardown_func)(test_logintitle)