I'm writing a test suite for Django that runs tests in a tree-like fashion. For example, Testcase A might have 2 outcomes, and Testcase B might have 1, and Testcase C might have 3. The tree looks like this
X
/
A-B-C-X
\ \
B X
\ X
\ /
C-X
\
X
For each path in the tree above, the database contents may be different. So at each fork, I'm thinking of creating an in-memory copy of the current state of the database, and then feeding that parameter into the next test.
Anyone have an idea about how to essentially copy the in-memory database to another one, and then get a reference to pass that database around?
Thanks!