From a455e732a0011dfbd15eddaa4fe60cb9439326e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigurd=20Lj=C3=B8dal?= Date: Thu, 28 Sep 2017 22:39:03 +0200 Subject: Fixed #28650 -- Added TruncWeek database function. --- tests/dates/tests.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests/dates') diff --git a/tests/dates/tests.py b/tests/dates/tests.py index 9cb77fe9e2..ebdf05812e 100644 --- a/tests/dates/tests.py +++ b/tests/dates/tests.py @@ -55,6 +55,12 @@ class DatesTests(TestCase): datetime.date(2010, 7, 1), ], ) + self.assertSequenceEqual( + Comment.objects.dates("article__pub_date", "week"), [ + datetime.date(2005, 7, 25), + datetime.date(2010, 7, 26), + ], + ) self.assertSequenceEqual( Comment.objects.dates("article__pub_date", "day"), [ datetime.date(2005, 7, 28), @@ -93,7 +99,8 @@ class DatesTests(TestCase): ) def test_dates_fails_when_given_invalid_kind_argument(self): - with self.assertRaisesMessage(AssertionError, "'kind' must be one of 'year', 'month' or 'day'."): + msg = "'kind' must be one of 'year', 'month', 'week', or 'day'." + with self.assertRaisesMessage(AssertionError, msg): Article.objects.dates("pub_date", "bad_kind") def test_dates_fails_when_given_invalid_order_argument(self): -- cgit v1.2.1