#672: can't unit-test a model that uses inheritance
--------------------------------+-------------------------------------------
 Reporter:  [EMAIL PROTECTED]  |       Owner:  anonymous            
     Type:  defect              |      Status:  new                  
 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):
   File
 "/usr/local/lib/python2.4/site-
 packages/TurboGears-0.9a1-py2.4.egg/turbogears/testutil.py",
 line 73, in setUp
     item.createTable(ifNotExists=True)
   File
 "/usr/local/lib/python2.4/site-
 packages/SQLObject-0.7.1dev_r1588-py2.4.egg/sqlobject/main.py",
 line 1319, in createTable
     conn = connection or cls._connection
   File
 "/usr/local/lib/python2.4/site-
 packages/SQLObject-0.7.1dev_r1588-py2.4.egg/sqlobject/dbconnection.py",
 line 881, in __get__
     return self.getConnection()
   File
 "/usr/local/lib/python2.4/site-
 packages/SQLObject-0.7.1dev_r1588-py2.4.egg/sqlobject/dbconnection.py",
 line 893, in getConnection
     raise AttributeError(
 AttributeError: No connection has been defined for this thread or
 process
 }}}

 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.

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/672>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Tickets" 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-tickets
-~----------~----~----~----~------~----~------~--~---

Reply via email to