I'm migrating project to django 2.2 from django 1.11. We have database based cache that runs on different database (not on default). When running tests, we get the following error:
AssertionError: Database queries to 'cache' are not allowed in this test. Add 'cache' to users.tests.UserLogTestCase.databases to ensure proper test isolation and silence this failure.
Adding the 'cache' database to the databases variable of the TestCase solves the problem (or setting it to '__all__
'), the problem is that this has to be done per test.
Is there any other (more global) way to solve this?