From 9eafb6592e9ed27a59cb3cd9920c44cf230a6c65 Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Wed, 29 Aug 2012 00:02:53 +0200 Subject: [PATCH] [py3] Fixed test failures introduced in 3afb5916b215c79e36408b729c9516bc435f5cb7. --- tests/regressiontests/admin_scripts/tests.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py index 3af291b806..2710f80929 100644 --- a/tests/regressiontests/admin_scripts/tests.py +++ b/tests/regressiontests/admin_scripts/tests.py @@ -1,8 +1,10 @@ +# -*- coding: utf-8 -*- """ A series of tests to establish that the command-line managment tools work as advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE and default settings.py files. """ +from __future__ import unicode_literals import os import re @@ -10,6 +12,7 @@ import shutil import socket import subprocess import sys +import codecs from django import conf, bin, get_version from django.conf import settings @@ -1584,5 +1587,6 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase): self.addCleanup(shutil.rmtree, testproject_dir) self.assertNoOutput(err) self.assertTrue(os.path.isdir(testproject_dir)) - self.assertEqual(open(os.path.join(testproject_dir, 'ticket-18091-non-ascii-template.txt')).read(), - 'Some non-ASCII text for testing ticket #18091:\n\xc3\xbc\xc3\xa4\xc3\xb6 \xe2\x82\xac\n') + path = os.path.join(testproject_dir, 'ticket-18091-non-ascii-template.txt') + self.assertEqual(codecs.open(path, 'r', 'utf-8').read(), + 'Some non-ASCII text for testing ticket #18091:\nüäö €\n')