In-memory ORM’s don’t really work since the Django ORM is really an SQL generator. It would also prevent you from using more advanced features.
You can speed up PostgreSQL by mounting it on an in-memory filesystem. In docker-compose this is as easy as:
The other thing you can do is reduce the amount of database usage in your tests. A key way to achieve this is to use
setUpTestData, alongside making sure you use
TestCase instead of
TransactionTestCase as much as possible.
There’s a lot to cover here… so much I wrote a book…