[Zope] Strategies for testing generated sql?
marco.bizzarri at gmail.com
Fri Apr 14 03:27:22 EDT 2006
On 4/12/06, Paul Winkler <pw_lists at slinkp.com> wrote:
> Functionally, we are missing some important testables:
> * we have no way to verify that these queries are syntactically correct
> * we have no way to verify that these queries behave as expected against
> a sample data set.
> How do people test this sort of thing? Do you go whole-hog and
> fire up MySQL or whatever? Or use gadfly? sqlite? or what?
> Are there other tools I should know about?
Sorry, It is taking a little more than I expected to prepare the sample.
However, I can provide some idea on this topic. We do this using
Basically, we have a test database (postgresql, but it can be used for
whatever transactional database). Each user has its own database, based on
The test does actual queries on the test database. At the end of each test
(single test, not test suite), there is a rollback (if you're using a Z
Database Adapter, this is done automatically by the transaction machinery).
So, each single test runs with a "fresh" copy of the database.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Zope