File: 0001-Call-django.setup-before-running-tests-for-Django-1..patch

package info (click to toggle)
python-django-openstack-auth 1.1.6-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 552 kB
  • ctags: 183
  • sloc: python: 1,723; makefile: 31
file content (28 lines) | stat: -rw-r--r-- 804 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From 26c0fbc8e85a59e25feb3414f5504f98de14d47e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= <hertzog@debian.org>
Date: Fri, 5 Sep 2014 17:20:49 +0200
Subject: [PATCH 1/2] Call django.setup() before running tests for Django 1.7
 compatibility

---
 openstack_auth/tests/run_tests.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/openstack_auth/tests/run_tests.py b/openstack_auth/tests/run_tests.py
index 0252903..46c474c 100644
--- a/openstack_auth/tests/run_tests.py
+++ b/openstack_auth/tests/run_tests.py
@@ -21,6 +21,10 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_auth.tests.settings'
 
 from django.test import simple as test_simple
 
+import django
+if hasattr(django, 'setup'):
+    django.setup()
+
 
 def run(*test_args):
     if not test_args:
-- 
2.1.0