From 8b77d3f69f560aac666aa2daba4edd61d062c9d0 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 26 Feb 2017 18:41:22 +0100 Subject: Tests: add views creation to _pre_setup. --- ishtar_common/tests.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ishtar_common/tests.py') diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 9395227b2..a9e92e1f2 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -41,6 +41,8 @@ from ishtar_common import forms_common from ishtar_common.utils import post_save_point from archaeological_context_records.models import CRBulkView +from archaeological_finds.models import BFBulkView, FBulkView, FirstBaseFindView + """ from django.conf import settings import tempfile, datetime @@ -87,9 +89,11 @@ def create_user(): class TestCase(BaseTestCase): def _pre_setup(self): super(TestCase, self)._pre_setup() - if not settings.USE_SPATIALITE_FOR_TESTS: - c = connection.cursor() - c.execute(CRBulkView.CREATE_SQL) + if settings.USE_SPATIALITE_FOR_TESTS: + return + c = connection.cursor() + for view in [CRBulkView, FirstBaseFindView, BFBulkView, FBulkView]: + c.execute(view.CREATE_SQL) transaction.commit_unless_managed() -- cgit v1.2.3