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 #672 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

can't unit-test a model that uses inheritance

Reported by: roger@… Owned by: anonymous
Priority: normal Milestone: 0.9a2
Component: TurboGears Version:
Severity: normal Keywords: nosetests inheritance


In TurboGears 0.9a1 (which version is not selectable in trac, btw), nosetests will run the unit tests for a project that doesn't use inheritance. As soon as you add this line to model.py:

    from sqlobject.inheritance import InheritableSQLObject

SQLObject raises an exception:

Traceback (most recent call last):
line 73, in setUp
line 1319, in createTable
    conn = connection or cls._connection
line 881, in __get__
    return self.getConnection()
line 893, in getConnection
    raise AttributeError(
AttributeError: No connection has been defined for this thread or

Note that this occurs even without actually using inheritance in the model; just importing InheritableSQLObject is enough to trigger it.

I'm reporting this against the "TurboGears" component because I believe it's in the testutil code.

This means that TurboGears does not presently support unit testing of a model that uses inheritance.

Change History

comment:1 Changed 13 years ago by kevin

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in [1004].

Note: See TracTickets for help on using tickets.