Skip to content

Commit c27362a

Browse files
committed
Fixes for Django 1.10
1 parent 9b7bc45 commit c27362a

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[pytest]
1+
[tool:pytest]
22
python_paths = tests/test_project
33
testpaths = tests/unit_tests tests/integration_tests
44
addopts =

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
],
2424
extras_require={
2525
'test': [
26-
'django',
27-
'pytest',
28-
'pytest-django',
29-
'pytest-cov',
30-
'pytest-pythonpath'
26+
'django~=1.8',
27+
'pytest~=3.0',
28+
'pytest-django~=3.0',
29+
'pytest-cov~=2.4',
30+
'pytest-pythonpath~=0.7'
3131
]
3232
},
3333
classifiers=[

tests/test_project/test_project/settings.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,25 @@
1818
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
1919
'compressor.finders.CompressorFinder'
2020
)
21-
MIDDLEWARE_CLASSES = ()
22-
TEMPLATE_CONTEXT_PROCESSORS = (
23-
'django.template.context_processors.static',
24-
)
21+
# Django < 1.8
22+
TEMPLATE_CONTEXT_PROCESSORS = [
23+
'django.template.context_processors.static'
24+
]
25+
# Django >= 1.8
26+
TEMPLATES = [{
27+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
28+
'APP_DIRS': True,
29+
'OPTIONS': {
30+
'context_processors': [
31+
'django.template.context_processors.static'
32+
]
33+
}
34+
}]
35+
# Django < 1.10
36+
MIDDLEWARE_CLASSES = []
37+
# Django >= 1.10
38+
MIDDLEWARE = []
39+
# django-compressor settings
2540
COMPRESS_ROOT = os.path.join(BASE_DIR, 'compressor')
2641
COMPRESS_PRECOMPILERS = (
2742
('text/x-scss', 'compressor_toolkit.precompilers.SCSSCompiler'),

0 commit comments

Comments
 (0)