3 from turbogears import testutil
4 from monitorweb.controllers import Root
9 class TestPages(unittest.TestCase):
12 turbogears.startup.startTurboGears()
15 """Tests for apps using identity need to stop CP/TG after each test to
16 stop the VisitManager thread.
17 See http://trac.turbogears.org/turbogears/ticket/1217 for details.
19 turbogears.startup.stopTurboGears()
21 def test_method(self):
22 "the index method should return a string called now"
24 result = testutil.call(cherrypy.root.index)
25 assert type(result["now"]) == types.StringType
27 def test_indextitle(self):
28 "The indexpage should have the right title"
29 testutil.create_request("/")
30 response = cherrypy.response.body[0].lower()
31 assert "<title>welcome to turbogears</title>" in response