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 #1101 (closed defect: duplicate)

Opened 13 years ago

Last modified 9 years ago

DBTest + sqlalchemy problems

Reported by: arthur Owned by: anonymous
Priority: normal Milestone: 1.1.x bugfix
Component: SQLAlchemy Version: 0.9a5
Severity: normal Keywords:

Description (last modified by jorge.vargas) (diff)

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 = "spam@python.not",
                       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:

so setup fails.

Change History

comment:1 Changed 13 years ago by jorge.vargas

  • Component changed from CherryPy to tests
  • Description modified (diff)
  • Milestone set to 1.0

arthur please preview your tickets before posting.

comment:2 Changed 12 years ago by alberto

  • Milestone changed from 1.0 to 1.1

comment:3 Changed 12 years ago by Chris Arndt

I was able to sucessfully test my SQLAlchemy model with this code:

comment:4 Changed 12 years ago by alberto

  • Milestone changed from 1.1 to __unclassified__

Batch moved into unclassified from 1.1 to properly track progress on the later

comment:5 Changed 12 years ago by paj

  • Component changed from tests to SQLAlchemy

comment:6 Changed 11 years ago by Chris Arndt

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

This is a duplicate to #1764. This is fixed r5277 for the 1.1 branch. This will not be fixed for the 1.0 branch (see also #1901).

comment:7 Changed 9 years ago by chrisz

  • Milestone changed from __unclassified__ to 1.1.x bugfix
Note: See TracTickets for help on using tickets.