With a fresh quickstart TG 1.0.1 instance (using SQLAlchemy), two of
the controller tests do not pass out of the box.
----
$ tg-admin quickstart --sqlalchemy --identity temp3
$ cd temp3
$ nosetests -v
temp3.tests.test_controllers.test_method ... Registering Service
temp3: development._http._tcp port 8080 path=/
ok
temp3.tests.test_controllers.test_indextitle ... FAIL
temp3.tests.test_controllers.test_logintitle ... FAIL
======================================================================
FAIL: /Users/chris/src/Python/TurboGears/temp3/temp3:
temp3.tests.test_controllers.test_indextitle
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/nose-0.9.2-py2.4.egg/nose/case.py", line 52,
in runTest
self.testFunc()
File "/Users/chris/src/Python/TurboGears/temp3/temp3/temp3/tests/
test_controllers.py", line 26, in test_indextitle
assert "<TITLE>Welcome to TurboGears</TITLE>" in
cherrypy.response.body[0]
AssertionError
======================================================================
FAIL: /Users/chris/src/Python/TurboGears/temp3/temp3:
temp3.tests.test_controllers.test_logintitle
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/nose-0.9.2-py2.4.egg/nose/case.py", line 52,
in runTest
self.testFunc()
File "/Users/chris/src/Python/TurboGears/temp3/temp3/temp3/tests/
test_controllers.py", line 32, in test_logintitle
assert "<TITLE>Login</TITLE>" in cherrypy.response.body[0]
AssertionError
----------------------------------------------------------------------
Ran 3 tests in 1.090s
FAILED (failures=2)
----
At first glance it looked like a case mis-match with the "<TITLE>"
assertion, but even changing these to be case-insensitive matches
doesn't help.
Examining the response body within the test shows it is receiving a
500 error, containing the following exception:
----
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/
_cphttptools.py", line 103, in _run
applyFilters('before_main')
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/filters/
__init__.py", line 151, in applyFilters
method()
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/TurboGears-1.0.1-py2.4.egg/turbogears/visit/
api.py", line 157, in before_main
plugin.record_request( visit )
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/TurboGears-1.0.1-py2.4.egg/turbogears/identity/
visitor.py", line 173, in record_request
set_current_identity( identity )
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/TurboGears-1.0.1-py2.4.egg/turbogears/identity/
__init__.py", line 105, in set_current_identity
cherrypy.request.user_name = identity.user_name
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/TurboGears-1.0.1-py2.4.egg/turbogears/identity/
saprovider.py", line 50, in _get_user_name
if not self.user:
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/TurboGears-1.0.1-py2.4.egg/turbogears/identity/
saprovider.py", line 41, in _get_user
visit = session.query(visit_class).get_by(visit_key =
self.visit_key)
File "build/bdist.macosx-10.3-fat/egg/sqlalchemy/orm/query.py", line
93, in get_by
File "build/bdist.macosx-10.3-fat/egg/sqlalchemy/orm/query.py", line
252, in select_whereclause
File "build/bdist.macosx-10.3-fat/egg/sqlalchemy/orm/query.py", line
378, in _select_statement
File "build/bdist.macosx-10.3-fat/egg/sqlalchemy/orm/query.py", line
308, in execute
File "build/bdist.macosx-10.3-fat/egg/sqlalchemy/orm/session.py",
line 133, in execute
File "build/bdist.macosx-10.3-fat/egg/sqlalchemy/engine/base.py",
line 258, in execute
File "build/bdist.macosx-10.3-fat/egg/sqlalchemy/engine/base.py",
line 282, in execute_clauseelement
File "build/bdist.macosx-10.3-fat/egg/sqlalchemy/engine/base.py",
line 298, in execute_compiled
File "build/bdist.macosx-10.3-fat/egg/sqlalchemy/engine/base.py",
line 294, in proxy
File "build/bdist.macosx-10.3-fat/egg/sqlalchemy/engine/base.py",
line 332, in _execute_raw
File "build/bdist.macosx-10.3-fat/egg/sqlalchemy/engine/base.py",
line 351, in _execute
SQLError: (OperationalError) no such table: visit_identity 'SELECT
visit_identity.visit_key AS visit_identity_visit_key,
visit_identity.user_id AS visit_identity_user_id \nFROM visit_identity
\nWHERE visit_identity.visit_key = ? ORDER BY visit_identity.oid \n
LIMIT 1 OFFSET 0' ['e0954d1a422360159196191cfd21ecc0ebe9956e']
----
It looks like visit_identity table wasn't created. But the mechanics
of testutil and how to startup TurboGears properly are beyond me, so
any tips appreciated.
Cheers,
Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---