]> git.llucax.com Git - z.facultad/75.52/sercom.git/blob - sercom/tests/test_controllers.py
Agregar intento de test.
[z.facultad/75.52/sercom.git] / sercom / tests / test_controllers.py
1 import turbogears
2 from nose import with_setup
3 from turbogears import testutil
4 from sercom.controllers import Root
5 import cherrypy
6
7 def teardown_func():
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
10     for details.
11     """
12     turbogears.startup.stopTurboGears()
13
14 cherrypy.root = Root()
15
16 def test_method():
17     "the index method should return a string called now"
18     import types
19     result = testutil.call(cherrypy.root.index)
20     assert type(result["now"]) == types.StringType
21 test_method = with_setup(teardown=teardown_func)(test_method)
22
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)
28
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)