[Python-modules-commits] [django-sekizai] 02/05: Initialize Django before tests are run.

Michael Fladischer fladi at moszumanska.debian.org
Sat Dec 19 19:51:12 UTC 2015


This is an automated email from the git hooks/post-receive script.

fladi pushed a commit to branch master
in repository django-sekizai.

commit 7674f033153d0c2861ba186e8ab546b26214e498
Author: Michael Fladischer <fladi at debian.org>
Date:   Thu Oct 8 08:56:53 2015 -0700

    Initialize Django before tests are run.
    
     Django 1.7 introduced changes to its start-up sequence. See:
     https://docs.djangoproject.com/en/dev/releases/1.7/#standalone-scripts
    Last-Update: 2014-09-01
    Forwarded: https://github.com/ojii/django-sekizai/pull/39
    
    Patch-Name: django-1.7.patch
---
 runtests.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/runtests.py b/runtests.py
index cc3500e..d7f94b3 100644
--- a/runtests.py
+++ b/runtests.py
@@ -1,6 +1,7 @@
 # -*- coding: utf-8 -*-
 import os
 import sys
+import django
 
 urlpatterns = []
 
@@ -25,7 +26,7 @@ TEMPLATE_DIRS = [
 TEMPLATE_CONTEXT_PROCESSORS = [
     'sekizai.context_processors.sekizai',
 ]
-    
+
 
 ROOT_URLCONF = 'runtests'
 
@@ -55,6 +56,9 @@ def runtests():
     from django.test.utils import get_runner
     TestRunner = get_runner(settings)
 
+    if django.VERSION >= (1, 7):
+        django.setup()
+
     test_runner = TestRunner(verbosity=1, interactive=False, failfast=False)
     failures = test_runner.run_tests(INSTALLED_APPS)
     return failures

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-sekizai.git



More information about the Python-modules-commits mailing list