From 95d291861267e414df92c373b0eee02519987298 Mon Sep 17 00:00:00 2001 From: Bertrand Bordage Date: Sun, 4 Jun 2017 19:39:12 +0200 Subject: [PATCH] Fixes Python 2 tests. --- cachalot/apps.py | 2 ++ cachalot/tests/settings.py | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cachalot/apps.py b/cachalot/apps.py index c0d122a..5e31b28 100644 --- a/cachalot/apps.py +++ b/cachalot/apps.py @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + from django import VERSION as django_version from django.apps import AppConfig from django.conf import settings diff --git a/cachalot/tests/settings.py b/cachalot/tests/settings.py index eb2ab74..9c57f28 100644 --- a/cachalot/tests/settings.py +++ b/cachalot/tests/settings.py @@ -190,8 +190,8 @@ class SettingsTestCase(TestUtilsMixin, TransactionTestCase): self.assertListEqual(errors, []) warning001 = Warning( - "Cache backend 'django.core.cache.backends.db.DatabaseCache' " - "is not supported by django-cachalot.", + 'Cache backend %r is not supported by django-cachalot.' + % 'django.core.cache.backends.db.DatabaseCache', hint='Switch to a supported cache backend ' 'like Redis or Memcached.', id='cachalot.W001') @@ -223,8 +223,8 @@ class SettingsTestCase(TestUtilsMixin, TransactionTestCase): id='cachalot.W002' ) warning003 = Warning( - "Database engine 'django.db.backends.oracle' is not supported " - "by django-cachalot.", + 'Database engine %r is not supported by django-cachalot.' + % 'django.db.backends.oracle', hint='Switch to a supported database engine.', id='cachalot.W003' ) @@ -235,8 +235,8 @@ class SettingsTestCase(TestUtilsMixin, TransactionTestCase): id='cachalot.W004' ) error001 = Error( - "Database alias 'secondary' from `CACHALOT_DATABASES` " - "is not defined in `DATABASES`.", + 'Database alias %r from `CACHALOT_DATABASES` ' + 'is not defined in `DATABASES`.' % 'secondary', hint='Change `CACHALOT_DATABASES` to be compliant with' '`CACHALOT_DATABASES`', id='cachalot.E001',