summaryrefslogtreecommitdiff
path: root/tests/dates
diff options
context:
space:
mode:
authorHasan <hasan.r67@gmail.com>2016-01-18 12:15:45 +0330
committerTim Graham <timograham@gmail.com>2016-01-29 13:37:33 -0500
commit26ad01719d73823e65c0358a2ee9941e0a888a63 (patch)
tree9e458f4c3428400e0970554ce19f6ed02e862a3b /tests/dates
parent253adc2b8a52982139d40c4f55b3fd446e1cb8f3 (diff)
downloaddjango-26ad01719d73823e65c0358a2ee9941e0a888a63.tar.gz
Refs #26022 -- Replaced six.assertRaisesRegex with assertRaisesMessage as appropriate.
Diffstat (limited to 'tests/dates')
-rw-r--r--tests/dates/tests.py21
1 files changed, 4 insertions, 17 deletions
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):