Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixed #20483 -- Made TransactionTestCase faster. #1240
I don't believe using @override_settings would actually change anything. You still have to change global state (the used app-cache, or what the cache contains), so there is zero gain in that respect. And as mentioned in the ticket, you still have the problem that imports happen only once.
Using override_settings so that we don't have two things that do almost the same thing could be a good idea.
I think you can get rid of the nastiest parts of this changeset by requiring that all "cascades" are included in installed_apps. That is, all models which will need to be truncated or cascaded into by delete are included, and thus you will not need to do any changes there.
It is true that this is trading code complexity for testing speed. On my machine PostgreSQL tests are 4500s vs 300s between master and the original isolated_apps branch. IMO important enough to have some complexity.