[Python-modules-commits] [python-django] 01/01: Add patch to fix DEP-8 test. Closes: #816435
Raphaël Hertzog
hertzog at moszumanska.debian.org
Mon Jun 5 09:51:22 UTC 2017
This is an automated email from the git hooks/post-receive script.
hertzog pushed a commit to branch debian/master
in repository python-django.
commit 6ea430dd7e6265d1cea177092920ca6df21c8746
Author: Raphaël Hertzog <hertzog at debian.org>
Date: Mon Jun 5 11:50:57 2017 +0200
Add patch to fix DEP-8 test. Closes: #816435
---
debian/changelog | 4 +-
.../fix-test-middleware-classes-headers.patch | 62 ++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 65 insertions(+), 2 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index fdf7c75..47d407c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,8 @@
-python-django (1:1.10.7-2) UNRELEASED; urgency=medium
+python-django (1:1.10.7-2) unstable; urgency=medium
* Accept again migrations depending on initial migrations that
can be fake applied. Closes: #863267
- * TODO: backport https://github.com/django/django/pull/8575
+ * Add patch to fix DEP-8 test. Closes: #816435
-- Raphaël Hertzog <hertzog at debian.org> Mon, 29 May 2017 16:59:51 +0200
diff --git a/debian/patches/fix-test-middleware-classes-headers.patch b/debian/patches/fix-test-middleware-classes-headers.patch
new file mode 100644
index 0000000..da21f15
--- /dev/null
+++ b/debian/patches/fix-test-middleware-classes-headers.patch
@@ -0,0 +1,62 @@
+From fa63fc91ccc08b20ed4ca45e73f7aad2b38d9171 Mon Sep 17 00:00:00 2001
+From: Chris Lamb <chris at chris-lamb.co.uk>
+Date: Wed, 31 May 2017 15:25:09 +0100
+Subject: [PATCH] [1.11.x] Fixed #26755 -- Fixed
+ test_middleware_classes_headers if Django source isn't writable.
+
+Backport of 2ec56bb78237ebf58494d7a7f3262482399f0be6 from master
+---
+ tests/project_template/test_settings.py | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/tests/project_template/test_settings.py b/tests/project_template/test_settings.py
+index a0047dd836d..791c42e03ae 100644
+--- a/tests/project_template/test_settings.py
++++ b/tests/project_template/test_settings.py
+@@ -1,11 +1,12 @@
+ import os
+ import shutil
++import tempfile
+ import unittest
+
+ from django import conf
+ from django.test import TestCase
++from django.test.utils import extend_sys_path
+ from django.utils import six
+-from django.utils._os import upath
+
+
+ @unittest.skipIf(
+@@ -15,16 +16,16 @@
+ )
+ class TestStartProjectSettings(TestCase):
+ def setUp(self):
+- # Ensure settings.py exists
+- project_dir = os.path.join(
+- os.path.dirname(upath(conf.__file__)),
++ self.temp_dir = tempfile.TemporaryDirectory()
++ self.addCleanup(self.temp_dir.cleanup)
++ template_settings_py = os.path.join(
++ os.path.dirname(conf.__file__),
+ 'project_template',
+ 'project_name',
++ 'settings.py-tpl',
+ )
+- template_settings_py = os.path.join(project_dir, 'settings.py-tpl')
+- test_settings_py = os.path.join(project_dir, 'settings.py')
++ test_settings_py = os.path.join(self.temp_dir.name, 'test_settings.py')
+ shutil.copyfile(template_settings_py, test_settings_py)
+- self.addCleanup(os.remove, test_settings_py)
+
+ def test_middleware_headers(self):
+ """
+@@ -32,7 +33,8 @@ def test_middleware_headers(self):
+ change. For example, we never want "Vary: Cookie" to appear in the list
+ since it prevents the caching of responses.
+ """
+- from django.conf.project_template.project_name.settings import MIDDLEWARE
++ with extend_sys_path(self.temp_dir.name):
++ from test_settings import MIDDLEWARE
+
+ with self.settings(
+ MIDDLEWARE=MIDDLEWARE,
diff --git a/debian/patches/series b/debian/patches/series
index 7786c21..0583f21 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
06_use_debian_geoip_database_as_default.diff
fix-migration-fake-initial-1.patch
fix-migration-fake-initial-2.patch
+fix-test-middleware-classes-headers.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-django.git
More information about the Python-modules-commits
mailing list