#1101: DBTest + sqlalchemy problems
--------------------+-------------------------------------------------------
 Reporter:  arthur  |        Owner:  anonymous
     Type:  defect  |       Status:  new      
 Priority:  normal  |    Milestone:  1.0      
Component:  tests   |      Version:  0.9a5    
 Severity:  normal  |   Resolution:           
 Keywords:          |  
--------------------+-------------------------------------------------------
Changes (by jorge.vargas):

  * milestone:  => 1.0
  * component:  CherryPy => tests

Old description:

> unittests fail with sqlalchemy
>
> class TestUser(testutil.DBTest):
>     def get_model(self):
>         return User
>     def test_creation(self):
>         "Object creation should set the name"
>         obj = User(user_name = "creosote",
>                        email_address = "[EMAIL PROTECTED]",
>                        display_name = "Mr Creosote",
>                        password = "Wafer-thin Mint")
>         assert obj.display_name == "Mr Creosote"
>

>
> The problem is in testutil.py where there is no test for sqlalchemy:
>
> class DBTest(unittest.TestCase):
>     model = None
>
>     def setUp(self):
>         if not self.model:
>             self.model = get_model()
>             if not self.model:
>                 raise "Unable to run database tests without a model"
>
>         for item in self.model.__dict__.values():
>             if inspect.isclass(item) and issubclass(item,
>                 sqlobject.SQLObject) and item != sqlobject.SQLObject \
>                 and item != InheritableSQLObject:
>                 item.createTable(ifNotExists=True)
>
> so setup fails.

New description:

 unittests fail with sqlalchemy
 {{{
 class TestUser(testutil.DBTest):
     def get_model(self):
         return User
     def test_creation(self):
         "Object creation should set the name"
         obj = User(user_name = "creosote",
                        email_address = "[EMAIL PROTECTED]",
                        display_name = "Mr Creosote",
                        password = "Wafer-thin Mint")
         assert obj.display_name == "Mr Creosote"

 }}}

 The problem is in testutil.py where there is no test for sqlalchemy:
 {{{
 class DBTest(unittest.TestCase):
     model = None

     def setUp(self):
         if not self.model:
             self.model = get_model()
             if not self.model:
                 raise "Unable to run database tests without a model"

         for item in self.model.__dict__.values():
             if inspect.isclass(item) and issubclass(item,
                 sqlobject.SQLObject) and item != sqlobject.SQLObject \
                 and item != InheritableSQLObject:
                 item.createTable(ifNotExists=True)
 }}}
 so setup fails.

Comment:

 arthur please preview your tickets before posting.

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/1101>
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