Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2259 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

Model tests are broken in quickstarted applications

Reported by: Gustavo Owned by: Chris Arndt
Priority: highest Milestone: 2.0rc1
Component: Quickstart Templates Version: trunk
Severity: blocker Keywords: sqlalchemy, tests
Cc:

Description

When I run the test suite of a quickstarted application, its model-related tests fail. For example:

ERROR: daapp.tests.models.test_auth.TestUser.test_query_obj           
----------------------------------------------------------------------
Traceback (most recent call last):                                    
  File "/home/gustavo/System/Pyenvs/tg2/lib/python2.6/site-packages/nose-0.10.4-py2.6.egg/nose/case.py", line 363, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/home/gustavo/System/Pyenvs/tg2/lib/python2.6/site-packages/nose-0.10.4-py2.6.egg/nose/util.py", line 453, in try_run
    return func()
  File "/home/gustavo/Projeti/TurboGears/FakeProjects/daapp/daapp/tests/models/__init__.py", line 22, in setup
    DBSession.flush()
  File "/home/gustavo/System/Pyenvs/tg2/lib/python2.6/site-packages/SQLAlchemy-0.5.2-py2.6.egg/sqlalchemy/orm/scoping.py", line 121, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "/home/gustavo/System/Pyenvs/tg2/lib/python2.6/site-packages/SQLAlchemy-0.5.2-py2.6.egg/sqlalchemy/orm/session.py", line 1347, in flush
    self._flush(objects)
  File "/home/gustavo/System/Pyenvs/tg2/lib/python2.6/site-packages/SQLAlchemy-0.5.2-py2.6.egg/sqlalchemy/orm/session.py", line 1417, in _flush
    flush_context.execute()
  File "/home/gustavo/System/Pyenvs/tg2/lib/python2.6/site-packages/SQLAlchemy-0.5.2-py2.6.egg/sqlalchemy/orm/unitofwork.py", line 244, in execute
    UOWExecutor().execute(self, tasks)
  File "/home/gustavo/System/Pyenvs/tg2/lib/python2.6/site-packages/SQLAlchemy-0.5.2-py2.6.egg/sqlalchemy/orm/unitofwork.py", line 707, in execute
    self.execute_save_steps(trans, task)
  File "/home/gustavo/System/Pyenvs/tg2/lib/python2.6/site-packages/SQLAlchemy-0.5.2-py2.6.egg/sqlalchemy/orm/unitofwork.py", line 722, in execute_save_steps
    self.save_objects(trans, task)
  File "/home/gustavo/System/Pyenvs/tg2/lib/python2.6/site-packages/SQLAlchemy-0.5.2-py2.6.egg/sqlalchemy/orm/unitofwork.py", line 713, in save_objects
    task.mapper._save_obj(task.polymorphic_tosave_objects, trans)
  File "/home/gustavo/System/Pyenvs/tg2/lib/python2.6/site-packages/SQLAlchemy-0.5.2-py2.6.egg/sqlalchemy/orm/mapper.py", line 1352, in _save_obj
    c = connection.execute(statement.values(value_params), params)
  File "/home/gustavo/System/Pyenvs/tg2/lib/python2.6/site-packages/SQLAlchemy-0.5.2-py2.6.egg/sqlalchemy/engine/base.py", line 824, in execute
    return Connection.executors[c](self, object, multiparams, params)
  File "/home/gustavo/System/Pyenvs/tg2/lib/python2.6/site-packages/SQLAlchemy-0.5.2-py2.6.egg/sqlalchemy/engine/base.py", line 874, in _execute_clauseelement
    return self.__execute_context(context)
  File "/home/gustavo/System/Pyenvs/tg2/lib/python2.6/site-packages/SQLAlchemy-0.5.2-py2.6.egg/sqlalchemy/engine/base.py", line 896, in __execute_context
    self._cursor_execute(context.cursor, context.statement, context.parameters[0], context=context)
  File "/home/gustavo/System/Pyenvs/tg2/lib/python2.6/site-packages/SQLAlchemy-0.5.2-py2.6.egg/sqlalchemy/engine/base.py", line 950, in _cursor_execute
    self._handle_dbapi_exception(e, statement, parameters, cursor, context)
  File "/home/gustavo/System/Pyenvs/tg2/lib/python2.6/site-packages/SQLAlchemy-0.5.2-py2.6.egg/sqlalchemy/engine/base.py", line 931, in _handle_dbapi_exception
    raise exc.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect)
OperationalError: (OperationalError) no such table: tg_user u'INSERT INTO tg_user (user_name, email_address, display_name, password, created) VALUES (?, ?, ?, ?, ?)' [u'ignucius', u'ignucius@example.org', None, None, '2009-03-04 21:46:49.059577']

#2243 is possibly related.

Change History

comment:1 Changed 10 years ago by mramm

I belelive these were all fixed in b7. Is anybody still experiencing problems?

comment:2 Changed 10 years ago by mramm

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.