Kevin Dangoor wrote:
I don't remember what all is done by SQLObject's test code, but I was guessing that we'd be able to use that code. There's no reason that tests really need to use the PackageHub for their connections.
I wouldn't reuse SQLObject's own test code. It was written before ConnectionHub, so has some added complexity there, and also has some optimizations that make things more complex and I suspect don't actually make the tests run any faster.
Ultimately, this should be fairly easy I think. It's a matter of getting the configuration right, and reseting the application database in some way. Probably there should be a routine that clears all tables and inserts some standard data, and then some testing data. I'd like to add the concept of "standard data" to SQLObject itself, so that createTable will automatically handle it (or whatever... maybe a "standard data once this set of tables has all been created" would be more appropriate).
I think creating test data is best done just with Python statements; fancy config files or YAML or whatever isn't going to be much more compact. But routines to perhaps dump and reload to CSV or something might be nice -- e.g., fiddle with a blank database with catwalk, then dump the results, giving you something interesting to test against. The results are hard to edit, though, especially relations.
One interesting thing that Rails does is, when possible, run the test in a transaction. When the test is through, roll the transaction back and the database is at its original state. This is much faster than reseting all the data for each test.
-- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org

