Commit f8978f7e authored by Michal Čihař's avatar Michal Čihař

Silence Python 3 deprecation warnings

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 553fb910
...@@ -22,6 +22,8 @@ from unittest import TestCase ...@@ -22,6 +22,8 @@ from unittest import TestCase
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from six import assertRaisesRegex
from weblate.trans.util import load_class from weblate.trans.util import load_class
...@@ -31,7 +33,7 @@ class LoadClassTest(TestCase): ...@@ -31,7 +33,7 @@ class LoadClassTest(TestCase):
self.assertEqual(cls, TestCase) self.assertEqual(cls, TestCase)
def test_invalid_name(self): def test_invalid_name(self):
self.assertRaisesRegexp( assertRaisesRegex(
ImproperlyConfigured, ImproperlyConfigured,
'Error importing class unittest in TEST: .*"' 'Error importing class unittest in TEST: .*"'
'(not enough|need more than)', '(not enough|need more than)',
...@@ -39,7 +41,7 @@ class LoadClassTest(TestCase): ...@@ -39,7 +41,7 @@ class LoadClassTest(TestCase):
) )
def test_invalid_module(self): def test_invalid_module(self):
self.assertRaisesRegexp( assertRaisesRegex(
ImproperlyConfigured, ImproperlyConfigured,
'weblate.trans.tests.missing in TEST: "' 'weblate.trans.tests.missing in TEST: "'
'No module named .*missing["\']', 'No module named .*missing["\']',
...@@ -47,7 +49,7 @@ class LoadClassTest(TestCase): ...@@ -47,7 +49,7 @@ class LoadClassTest(TestCase):
) )
def test_invalid_class(self): def test_invalid_class(self):
self.assertRaisesRegexp( assertRaisesRegex(
ImproperlyConfigured, ImproperlyConfigured,
'"weblate.trans.tests.test_utils" does not define a "Foo" class', '"weblate.trans.tests.test_utils" does not define a "Foo" class',
load_class, 'weblate.trans.tests.test_utils.Foo', 'TEST' load_class, 'weblate.trans.tests.test_utils.Foo', 'TEST'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment