From 26ad01719d73823e65c0358a2ee9941e0a888a63 Mon Sep 17 00:00:00 2001 From: Hasan Date: Mon, 18 Jan 2016 12:15:45 +0330 Subject: Refs #26022 -- Replaced six.assertRaisesRegex with assertRaisesMessage as appropriate. --- tests/dates/tests.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'tests/dates') diff --git a/tests/dates/tests.py b/tests/dates/tests.py index 97c4face6e..5d7bd0fb97 100644 --- a/tests/dates/tests.py +++ b/tests/dates/tests.py @@ -102,25 +102,12 @@ class DatesTests(TestCase): ) def test_dates_fails_when_given_invalid_kind_argument(self): - six.assertRaisesRegex( - self, - AssertionError, - "'kind' must be one of 'year', 'month' or 'day'.", - Article.objects.dates, - "pub_date", - "bad_kind", - ) + with self.assertRaisesMessage(AssertionError, "'kind' must be one of 'year', 'month' or 'day'."): + Article.objects.dates("pub_date", "bad_kind") def test_dates_fails_when_given_invalid_order_argument(self): - six.assertRaisesRegex( - self, - AssertionError, - "'order' must be either 'ASC' or 'DESC'.", - Article.objects.dates, - "pub_date", - "year", - order="bad order", - ) + with self.assertRaisesMessage(AssertionError, "'order' must be either 'ASC' or 'DESC'."): + Article.objects.dates("pub_date", "year", order="bad order") @override_settings(USE_TZ=False) def test_dates_trunc_datetime_fields(self): -- cgit v1.2.1