[PATCH 11/11] settings: Fix deprecated 'TEST_CHARSET' warning

Stephen Finucane stephen.finucane at intel.com
Mon Jun 29 23:46:11 AEST 2015


Resolve a 'RemovedInDjango19Warning' with the 'TEST_CHARSET' option.

In addition, move a setting from 'settings.base' into the correct
location.

Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>
---
 patchwork/settings/base.py | 6 ++++--
 patchwork/settings/dev.py  | 8 +++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py
index 5b40bcb..d00245d 100644
--- a/patchwork/settings/base.py
+++ b/patchwork/settings/base.py
@@ -50,6 +50,10 @@ LANGUAGE_CODE = 'en-au'
 
 USE_I18N = True
 
+# Testing
+
+TEST_RUNNER = 'django.test.runner.DiscoverRunner'
+
 # URLs
 
 ROOT_URLCONF = 'patchwork.urls'
@@ -113,5 +117,3 @@ COMPAT_REDIR = True
 # the scheme based on current access. This is useful if SSL protocol
 # is terminated upstream of the server (e.g. at the load balancer)
 FORCE_HTTPS_LINKS = False
-
-TEST_RUNNER = 'django.test.runner.DiscoverRunner'
diff --git a/patchwork/settings/dev.py b/patchwork/settings/dev.py
index 3f2355d..e93249c 100644
--- a/patchwork/settings/dev.py
+++ b/patchwork/settings/dev.py
@@ -38,10 +38,16 @@ DATABASES = {
         'USER': os.environ['PW_TEST_DB_USER'],
         'PASSWORD': os.environ['PW_TEST_DB_PASS'],
         'NAME': 'patchwork',
-        'TEST_CHARSET': 'utf8',
     },
 }
 
+if django.VERSION < (1, 7):
+    DATABASES['default']['TEST_CHARSET'] = 'utf8'
+else:
+    DATABASES['default']['TEST'] = {
+        'CHARSET': 'utf8',
+    }
+
 #
 # Patchwork settings
 #
-- 
2.0.0



More information about the Patchwork mailing list