[PATCH v2 15/16] settings: Fix deprecated 'TEST_CHARSET' warning

Stephen Finucane stephen.finucane at intel.com
Sat Aug 22 00:32:19 AEST 2015


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

Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>
---
 patchwork/settings/dev.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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