diff options
-rw-r--r-- | CREDITS | 1 | ||||
-rw-r--r-- | tests/django_test_app/__init__.py | 24 | ||||
-rw-r--r-- | tests/test_django.py | 12 |
3 files changed, 25 insertions, 12 deletions
@@ -18,6 +18,7 @@ Contributors The project has received contributions from (in alphabetical order): * Raphaƫl Barrois <raphael.barrois+semver@polytechnique.org> (https://github.com/rbarrois) +* Michael Hrivnak <mhrivnak@hrivnak.org> (https://github.com/mhrivnak) Contributor license agreement diff --git a/tests/django_test_app/__init__.py b/tests/django_test_app/__init__.py index e69de29..1c692b0 100644 --- a/tests/django_test_app/__init__.py +++ b/tests/django_test_app/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2012-2014 The python-semanticversion project +# This code is distributed under the two-clause BSD License. + +try: # pragma: no cover + from django.conf import settings + django_loaded = True +except ImportError: # pragma: no cover + django_loaded = False + + +if django_loaded: # pragma: no cover + if not settings.configured: + settings.configure( + DATABASES={ + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': 'tests/db/test.sqlite', + } + }, + INSTALLED_APPS=[ + 'tests.django_test_app', + ] + ) diff --git a/tests/test_django.py b/tests/test_django.py index 0cb480b..35193fa 100644 --- a/tests/test_django.py +++ b/tests/test_django.py @@ -18,18 +18,6 @@ except ImportError: # pragma: no cover django_loaded = False if django_loaded: # pragma: no cover - if not settings.configured: - settings.configure( - DATABASES={ - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': 'tests/db/test.sqlite', - } - }, - INSTALLED_APPS=[ - 'tests.django_test_app', - ] - ) from .django_test_app import models from django.core import serializers |