Topic: Can't repeat unit tests of model that "acts_as_tree"

I have a model that I am using to hold the content of the navigation menus of an application. The model is defined to "act_as_tree".

I spent quite a bit of time puzzling why my unit tests failed to load the test fixture until I realized that there is no guarantee that records from fixture yml files will be loaded in the sequence they are defined. (Q: Why not???)

Anyway, once I found the !omap qualifier I was off to the races - sort of :-)

If I re-create the test database, I can run the unit test suite once; but I can't run it a second time because of foreign key violations. I think the cause is that the transaction that wraps the unit test fails to delete the fixture data at the end of the transaction. I assume this is probably because the data is related, and has to be deleted in the reverse order to which it was created if one is to avoid foreign key violations.

So, how can I configure the unit tests so they can be repeated?

Gareth
PS I'll ask the more general question about ordering of data in a separate thread.