From 9ba0e4e4ee2725679ae5cb9e3dd637b0208e5ad3 Mon Sep 17 00:00:00 2001 From: Loic Bistuer Date: Wed, 6 Mar 2013 01:13:36 +0700 Subject: [PATCH] Fixed minor warnings in tests. --- tests/forms_tests/tests/regressions.py | 5 +++-- tests/utils_tests/module_loading.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/forms_tests/tests/regressions.py b/tests/forms_tests/tests/regressions.py index ecee92402e..4249b8afb7 100644 --- a/tests/forms_tests/tests/regressions.py +++ b/tests/forms_tests/tests/regressions.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -from warnings import catch_warnings +import warnings from django.forms import * from django.test import TestCase @@ -62,8 +62,9 @@ class FormsRegressionsTestCase(TestCase): (b'\xd1\x88\xd1\x82.', b'\xd1\x88\xd1\x82.')) f = ChoiceField(choices=UNITS) self.assertEqual(f.clean('\u0448\u0442.'), '\u0448\u0442.') - with catch_warnings(record=True): + with warnings.catch_warnings(): # Ignore UnicodeWarning + warnings.simplefilter("ignore") self.assertEqual(f.clean(b'\xd1\x88\xd1\x82.'), '\u0448\u0442.') # Translated error messages used to be buggy. diff --git a/tests/utils_tests/module_loading.py b/tests/utils_tests/module_loading.py index 9ff3f18d26..cd97e1436d 100644 --- a/tests/utils_tests/module_loading.py +++ b/tests/utils_tests/module_loading.py @@ -113,7 +113,7 @@ class ModuleImportTestCase(unittest.TestCase): # Test exceptions raised for path in ('no_dots_in_path', 'unexistent.path', - 'tests.utils_tests.unexistent'): + 'utils_tests.unexistent'): self.assertRaises(ImproperlyConfigured, import_by_path, path) with self.assertRaises(ImproperlyConfigured) as cm: