This monkey-patches django.tests.testcases.TestCase
so that all tests in a TestCase
take place in a BEGIN
transaction, while test methods take place in a nested transaction, with a savepoint being recorded after fixtures are loaded before a test, and rolling back to it after ...
Afaik, only the Oracle and Postgres backends has this; sqlite already has it for almost a year now, but there still isn't support for it in django.
I've posted a patch for inclusion; it'll be interesting to see how it goes.
Perusing the builtin-sqlite3 docs, as well as those of pysqlite, doesn't seem to offer much clue to using these.
After lots of hair-tearing, I think I've got it figured out.
Here's what most people usually do on their first try:
cur1.execute("create table test(i)")
cur1 ...