﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26755	test_middleware_classes_headers fails when django files aren't writable	Raphaël Hertzog	nobody	"commit abc0777b63057e2ff97eee2ff184356051e14c47 broke the test suite Debian runs against the installed package:
https://ci.debian.net/data/packages/unstable/amd64/p/python-django/20160610_144236.autopkgtest.log.gz

The problem is that the setUp() method tries to create a file in the django/conf/project_template/project_name/ directory but that directory is owned by root:root in the installed Debian package.
The test suite should not assume that it can write to the tree hosting the django code.

A possible fix would be to use some import magic:
{{{
with open(template_settings_py) as f:
    m = imp.load_module('settings', f, template_settings_py, ('', '', imp.PY_SOURCE))
}}}
(I can't figure out the equivalent with the importlib module)

Or to copy the file to a temporary directory that you add to sys.path."	Cleanup/optimization	closed	Core (Other)	1.9	Normal	fixed		Chris Lamb	Ready for checkin	1	0	0	0	0	0
