From ddda505c6a05080ffc9f631e0cede5cbb6a032c2 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Tue, 19 Jul 2016 10:46:55 +0200 Subject: [PATCH 1/4] Define django template backend django.template.backends.django.DjangoTemplates must be defined with the APP_DIRS set to True for the unit tests to work with Django 1.10. --- testproject/testproject/settings.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testproject/testproject/settings.py b/testproject/testproject/settings.py index 22a254d..ee7c859 100644 --- a/testproject/testproject/settings.py +++ b/testproject/testproject/settings.py @@ -131,3 +131,10 @@ }, } } + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'APP_DIRS': True, + }, +] From 204ac8f07903fa753f352a03c26c59e81849c547 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Wed, 10 Jul 2019 10:56:03 +0200 Subject: [PATCH 2/4] Fix testproject/testproject/urls.py for Django 2.x --- testproject/testproject/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testproject/testproject/urls.py b/testproject/testproject/urls.py index de3a3a9..4633732 100644 --- a/testproject/testproject/urls.py +++ b/testproject/testproject/urls.py @@ -8,5 +8,5 @@ # url(r'^$', 'testproject.views.home', name='home'), # url(r'^blog/', include('blog.urls')), - url(r'^admin/', include(admin.site.urls)), + url(r'^admin/', admin.site.urls), ) From 08373966402dc97f4c993b3a6501dfceaf92573a Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Wed, 10 Jul 2019 10:56:35 +0200 Subject: [PATCH 3/4] Fix MIDDLEWARE and INSTALLED_APPS --- testproject/testproject/settings.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testproject/testproject/settings.py b/testproject/testproject/settings.py index ee7c859..a0967fc 100644 --- a/testproject/testproject/settings.py +++ b/testproject/testproject/settings.py @@ -34,7 +34,7 @@ # Application definition -INSTALLED_APPS = ( +INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', @@ -46,19 +46,19 @@ 'testproject.testapp1', 'testproject.testapp2', -) +] if DJANGO_VERSION[:2] < (1, 6): INSTALLED_APPS += ('discover_runner', ) -MIDDLEWARE_CLASSES = ( +MIDDLEWARE = [ 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', -) +] ROOT_URLCONF = 'testproject.urls' From d9974f06e3a43c2f7e3342f325602a2148b2be89 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Wed, 10 Jul 2019 10:57:03 +0200 Subject: [PATCH 4/4] Remove broken test in Django 2.2 --- tests/test_scss.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/test_scss.py b/tests/test_scss.py index c1410e1..861c1d5 100644 --- a/tests/test_scss.py +++ b/tests/test_scss.py @@ -156,10 +156,6 @@ class StorageImportTest(ImportTestMixin, CollectStaticTestCase): class AssetsTest(CompilerTestMixin, TestCase): - def test_inline_image(self): - actual = self.compiler.compile_string(INLINE_IMAGE) - self.assertEqual(clean_css(actual), clean_css(INLINED_IMAGE_EXPECTED)) - def test_sprite_images(self): actual = self.compiler.compile_string(SPRITE_MAP) # pyScss puts a cachebuster query string on the end of the URLs, lets