Loading django/contrib/auth/tests/management.py +2 −2 Original line number Diff line number Diff line Loading @@ -186,7 +186,7 @@ class PermissionDuplicationTestCase(TestCase): # check duplicated default permission models.Permission._meta.permissions = [ ('change_permission', 'Can edit permission (duplicate)')] self.assertRaisesRegexp(CommandError, six.assertRaisesRegex(self, CommandError, "The permission codename 'change_permission' clashes with a " "builtin permission for model 'auth.Permission'.", create_permissions, models, [], verbosity=0) Loading @@ -197,7 +197,7 @@ class PermissionDuplicationTestCase(TestCase): ('other_one', 'Some other permission'), ('my_custom_permission', 'Some permission with duplicate permission code'), ] self.assertRaisesRegexp(CommandError, six.assertRaisesRegex(self, CommandError, "The permission codename 'my_custom_permission' is duplicated for model " "'auth.Permission'.", create_permissions, models, [], verbosity=0) Loading tests/modeltests/basic/tests.py +3 −3 Original line number Diff line number Diff line Loading @@ -140,21 +140,21 @@ class ModelTest(TestCase): # Django raises an Article.MultipleObjectsReturned exception if the # lookup matches more than one object self.assertRaisesRegexp( six.assertRaisesRegex(self, MultipleObjectsReturned, "get\(\) returned more than one Article -- it returned 2!", Article.objects.get, headline__startswith='Area', ) self.assertRaisesRegexp( six.assertRaisesRegex(self, MultipleObjectsReturned, "get\(\) returned more than one Article -- it returned 2!", Article.objects.get, pub_date__year=2005, ) self.assertRaisesRegexp( six.assertRaisesRegex(self, MultipleObjectsReturned, "get\(\) returned more than one Article -- it returned 2!", Article.objects.get, Loading tests/modeltests/str/tests.py +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class SimpleTests(TestCase): headline='Girl wins €12.500 in lottery', pub_date=datetime.datetime(2005, 7, 28) ) self.assertRaisesRegexp(RuntimeError, "Did you apply " six.assertRaisesRegex(self, RuntimeError, "Did you apply " "@python_2_unicode_compatible without defining __str__\?", str, a) def test_international(self): Loading tests/regressiontests/backends/tests.py +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ class OracleChecks(unittest.TestCase): # Check that '%' chars are escaped for query execution. name = '"SOME%NAME"' quoted_name = connection.ops.quote_name(name) self.assertEquals(quoted_name % (), name) self.assertEqual(quoted_name % (), name) @unittest.skipUnless(connection.vendor == 'oracle', "No need to check Oracle cursor semantics") Loading tests/regressiontests/templates/tests.py +2 −2 Original line number Diff line number Diff line Loading @@ -370,13 +370,13 @@ class Templates(TestCase): # Regression test for #19280 t = Template('{% url path.to.view %}') # not quoted = old syntax c = Context() with self.assertRaisesRegexp(urlresolvers.NoReverseMatch, with six.assertRaisesRegex(self, urlresolvers.NoReverseMatch, "The syntax changed in Django 1.5, see the docs."): t.render(c) def test_url_explicit_exception_for_old_syntax_at_compile_time(self): # Regression test for #19392 with self.assertRaisesRegexp(template.TemplateSyntaxError, with six.assertRaisesRegex(self, template.TemplateSyntaxError, "The syntax of 'url' changed in Django 1.5, see the docs."): t = Template('{% url my-view %}') # not a variable = old syntax Loading Loading
django/contrib/auth/tests/management.py +2 −2 Original line number Diff line number Diff line Loading @@ -186,7 +186,7 @@ class PermissionDuplicationTestCase(TestCase): # check duplicated default permission models.Permission._meta.permissions = [ ('change_permission', 'Can edit permission (duplicate)')] self.assertRaisesRegexp(CommandError, six.assertRaisesRegex(self, CommandError, "The permission codename 'change_permission' clashes with a " "builtin permission for model 'auth.Permission'.", create_permissions, models, [], verbosity=0) Loading @@ -197,7 +197,7 @@ class PermissionDuplicationTestCase(TestCase): ('other_one', 'Some other permission'), ('my_custom_permission', 'Some permission with duplicate permission code'), ] self.assertRaisesRegexp(CommandError, six.assertRaisesRegex(self, CommandError, "The permission codename 'my_custom_permission' is duplicated for model " "'auth.Permission'.", create_permissions, models, [], verbosity=0) Loading
tests/modeltests/basic/tests.py +3 −3 Original line number Diff line number Diff line Loading @@ -140,21 +140,21 @@ class ModelTest(TestCase): # Django raises an Article.MultipleObjectsReturned exception if the # lookup matches more than one object self.assertRaisesRegexp( six.assertRaisesRegex(self, MultipleObjectsReturned, "get\(\) returned more than one Article -- it returned 2!", Article.objects.get, headline__startswith='Area', ) self.assertRaisesRegexp( six.assertRaisesRegex(self, MultipleObjectsReturned, "get\(\) returned more than one Article -- it returned 2!", Article.objects.get, pub_date__year=2005, ) self.assertRaisesRegexp( six.assertRaisesRegex(self, MultipleObjectsReturned, "get\(\) returned more than one Article -- it returned 2!", Article.objects.get, Loading
tests/modeltests/str/tests.py +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class SimpleTests(TestCase): headline='Girl wins €12.500 in lottery', pub_date=datetime.datetime(2005, 7, 28) ) self.assertRaisesRegexp(RuntimeError, "Did you apply " six.assertRaisesRegex(self, RuntimeError, "Did you apply " "@python_2_unicode_compatible without defining __str__\?", str, a) def test_international(self): Loading
tests/regressiontests/backends/tests.py +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ class OracleChecks(unittest.TestCase): # Check that '%' chars are escaped for query execution. name = '"SOME%NAME"' quoted_name = connection.ops.quote_name(name) self.assertEquals(quoted_name % (), name) self.assertEqual(quoted_name % (), name) @unittest.skipUnless(connection.vendor == 'oracle', "No need to check Oracle cursor semantics") Loading
tests/regressiontests/templates/tests.py +2 −2 Original line number Diff line number Diff line Loading @@ -370,13 +370,13 @@ class Templates(TestCase): # Regression test for #19280 t = Template('{% url path.to.view %}') # not quoted = old syntax c = Context() with self.assertRaisesRegexp(urlresolvers.NoReverseMatch, with six.assertRaisesRegex(self, urlresolvers.NoReverseMatch, "The syntax changed in Django 1.5, see the docs."): t.render(c) def test_url_explicit_exception_for_old_syntax_at_compile_time(self): # Regression test for #19392 with self.assertRaisesRegexp(template.TemplateSyntaxError, with six.assertRaisesRegex(self, template.TemplateSyntaxError, "The syntax of 'url' changed in Django 1.5, see the docs."): t = Template('{% url my-view %}') # not a variable = old syntax Loading