I am trying to run a simple unit test in Django where I verify the template used. It is very similar to the test in TDD with Django:
from django.test import TestCase
class HomePageTest(TestCase):
def test_uses_home_template(self):
response = self.client.get('/')
self.assertTemplateUsed(response, 'home.html')
The problem is that the view uses a second database and it fails with the error:
django.db.utils.ProgrammingError: relation "public.secondary_db" does not exist
Is it possible to run this test without hitting the database at all? I know that multiple databases in Django is a known issue, but is there a way to avoid this issue all together?