Fix tests for multiple database support.

This commit is contained in:
Varuna Bamunusinghe 2019-05-03 10:17:11 +05:30 committed by Jan-Jelle Kester
parent 12af4d45a0
commit 9be61a84a1
2 changed files with 2 additions and 1 deletions

View file

@ -33,6 +33,6 @@ class PostgresRouter(object):
Make sure the postgres app only appears in the 'postgres db'
database.
"""
if model_name.startswith('postgres'):
if model_name and model_name.startswith('postgres'):
return db == 'postgres'
return None

View file

@ -575,6 +575,7 @@ class CharfieldTextfieldModelTest(TestCase):
class PostgresArrayFieldModelTest(TestCase):
databases = '__all__'
def setUp(self):
self.obj = PostgresArrayFieldModel.objects.create(