Okay, so I have unit tests that test my model(s). When I run them
directly, I use the following line to set up a connection:

sqlhub.processConnection = connectionForURI("myurihere")

When I try and use Testgears, it won't connect. I get this error:

Traceback (most recent call last):
  File
"/usr/home/ppetrick/repos/lab_manager/trunk/dev/server/server_core/core/tests/unit/test_domain.py",
line 19, in setUp
    self.dropTables()
  File
"/usr/home/ppetrick/repos/lab_manager/trunk/dev/server/server_core/core/tests/unit/test_domain.py",
line 25, in dropTables
    Domain.dropTable(ifExists=True,cascade=True)
  File
"/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/main.py",
line 1294, in dropTable
    conn = connection or cls._connection
  File
"/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/dbconnection.py",
line 848, in __get__
    return self.getConnection()
  File
"/usr/local/lib/python2.4/site-packages/TurboGears-0.8a4-py2.4.egg/turbogears/database.py",
line 36, in getConnection
    raise AttributeError(
AttributeError: No connection has been defined for this thread or
process


What the heck is the problem????????

Could someone post some example code to show what they're doing?  Also,
an explanation of what's happening under the hood would be mighty
helpful.

Reply via email to