import unittest import turbogears from turbogears import testutil from turbogears.database import bind_metadata, metadata, session from transifex.controllers import Root import cherrypy cherrypy.root = Root() class TestRootVisitor(unittest.TestCase): """Test how pages look to a visitor (non authenticated user).""" def setUp(self): turbogears.startup.startTurboGears() def tearDown(self): turbogears.startup.stopTurboGears() def test_indextitle(self): """Test that Index page has the right content.""" testutil.create_request("/") response = cherrypy.response.body[0].lower() assert "welcome to" in response def test_login_content(self): """Test that Login page has the right content.""" testutil.create_request("/login") response = cherrypy.response.body[0].lower() assert "login" in response assert "