[Python-modules-commits] [django-cors-headers] 04/05: Fix tests
Brian May
bam at moszumanska.debian.org
Wed Jul 5 22:27:31 UTC 2017
This is an automated email from the git hooks/post-receive script.
bam pushed a commit to branch debian/master
in repository django-cors-headers.
commit dd1e745a614db1c7e380a60cf28245041240800f
Author: Brian May <bam at debian.org>
Date: Wed Jul 5 22:15:35 2017 +1000
Fix tests
---
debian/control | 4 +++-
debian/rules | 2 +-
debian/run_tests.py | 24 ------------------------
debian/test_settings.py | 28 ----------------------------
4 files changed, 4 insertions(+), 54 deletions(-)
diff --git a/debian/control b/debian/control
index dfd05f9..b4cb229 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,9 @@ Section: python
Priority: optional
Build-Depends: debhelper (>= 9), dh-python,
python-setuptools (>= 0.6b3), python-mock, python-django, python-all (>= 2.6.6-3),
- python3-setuptools (>= 0.6b3), python3-mock, python3-django, python3-all
+ python-pytest, python-pytest-cov, python-pytest-django,
+ python3-setuptools (>= 0.6b3), python3-mock, python3-django, python3-all,
+ python3-pytest, python3-pytest-cov, python3-pytest-django,
Standards-Version: 4.0.0
Homepage: https://github.com/ottoyiu/django-cors-headers
Vcs-Browser: https://anonscm.debian.org/cgit/python-modules/packages/django-cors-headers.git
diff --git a/debian/rules b/debian/rules
index a8992d9..e41c142 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,5 +6,5 @@ export PYBUILD_NAME=django-cors-headers
override_dh_auto_test:
PYBUILD_SYSTEM=custom \
- PYBUILD_TEST_ARGS="{interpreter} $(CURDIR)/debian/run_tests.py" \
+ PYBUILD_TEST_ARGS="{interpreter} $(CURDIR)/runtests.py" \
dh_auto_test
diff --git a/debian/run_tests.py b/debian/run_tests.py
deleted file mode 100644
index 459d3c8..0000000
--- a/debian/run_tests.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-import os
-import sys
-import django
-
-os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings'
-test_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-sys.path.insert(0, test_dir)
-
-from django.test.utils import get_runner
-from django.conf import settings as s
-
-if django.VERSION > (1, 7, 0):
- django.setup()
-
-
-def run_tests():
- TestRunner = get_runner(s)
- test_runner = TestRunner(verbosity=1, interactive=True)
- failuers = test_runner.run_tests(['corsheaders.tests'])
- sys.exit(bool(failuers))
-
-if __name__ == '__main__':
- run_tests()
diff --git a/debian/test_settings.py b/debian/test_settings.py
deleted file mode 100644
index f2710bc..0000000
--- a/debian/test_settings.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# Django settings for testproject project.
-
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
-
-DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
- 'NAME': 'sqlite.db', # Or path to database file if using sqlite3.
- 'USER': '', # Not used with sqlite3.
- 'PASSWORD': '', # Not used with sqlite3.
- 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
- 'PORT': '', # Set to empty string for default. Not used with sqlite3.
- }
-}
-
-# Make this unique, and don't share it with anybody.
-SECRET_KEY = 'u at x-aj9(hoh#rb-^ymf#g2jx_hp0vj7u5#b at ag1n^seu9e!%cy'
-
-MIDDLEWARE_CLASSES = (
- 'django.middleware.common.CommonMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
-)
-
-TEST_RUNNER = "django.test.runner.DiscoverRunner"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-cors-headers.git
More information about the Python-modules-commits
mailing list