summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_scripts/tests.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@rd.io>2012-09-07 13:17:09 -0400
committerAlex Gaynor <alex.gaynor@rd.io>2012-09-07 13:17:34 -0400
commit292322f977b1844e15ba25d59d1e985461571c15 (patch)
treef5fc063c821bed123c7443eda5bc09b0fb16ed48 /tests/regressiontests/admin_scripts/tests.py
parent4321ee25c5c490b94fa0c6e2da5e0b3df215ff81 (diff)
[py3k] Silence many warnings while running the tests.
Diffstat (limited to 'tests/regressiontests/admin_scripts/tests.py')
-rw-r--r--tests/regressiontests/admin_scripts/tests.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py
index 2710f80929..bc0f684563 100644
--- a/tests/regressiontests/admin_scripts/tests.py
+++ b/tests/regressiontests/admin_scripts/tests.py
@@ -1576,7 +1576,6 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase):
self.assertOutput(err, "Destination directory '%s' does not exist, please create it first." % testproject_dir)
self.assertFalse(os.path.exists(testproject_dir))
-
def test_custom_project_template_with_non_ascii_templates(self):
"Ticket 18091: Make sure the startproject management command is able to render templates with non-ASCII content"
template_path = os.path.join(test_dir, 'admin_scripts', 'custom_templates', 'project_template')
@@ -1588,5 +1587,6 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase):
self.assertNoOutput(err)
self.assertTrue(os.path.isdir(testproject_dir))
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')
+ with codecs.open(path, 'r', 'utf-8') as f:
+ self.assertEqual(f.read(),
+ 'Some non-ASCII text for testing ticket #18091:\nüäö €\n')