diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-02-26 18:41:22 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-02-26 18:41:22 +0100 |
commit | b684b098c382ed19c7ed8889e050f0ef196c2b54 (patch) | |
tree | a542ab58e40c133b94e3c8d0d7f6162d726a709a /ishtar_common/tests.py | |
parent | 7538666202784f731291f82ca75e2ff2d84b1fe7 (diff) | |
download | Ishtar-b684b098c382ed19c7ed8889e050f0ef196c2b54.tar.bz2 Ishtar-b684b098c382ed19c7ed8889e050f0ef196c2b54.zip |
Tests: add views creation to _pre_setup.
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r-- | ishtar_common/tests.py | 10 |
1 files changed, 7 insertions, 3 deletions
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() |