summaryrefslogtreecommitdiff
path: root/tests/datetimes
diff options
context:
space:
mode:
authorSigurd Ljødal <sigurd@ljodal.no>2017-09-28 22:39:03 +0200
committerTim Graham <timograham@gmail.com>2018-01-27 09:59:13 -0500
commita455e732a0011dfbd15eddaa4fe60cb9439326e0 (patch)
tree1df72fb36c377ae630e1bbc8a588662f8f3cb46f /tests/datetimes
parentf229049d6cd186025f4033dc47608b0c9731e882 (diff)
downloaddjango-a455e732a0011dfbd15eddaa4fe60cb9439326e0.tar.gz
Fixed #28650 -- Added TruncWeek database function.
Diffstat (limited to 'tests/datetimes')
-rw-r--r--tests/datetimes/tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/datetimes/tests.py b/tests/datetimes/tests.py
index 50a83f0371..a9f1199f06 100644
--- a/tests/datetimes/tests.py
+++ b/tests/datetimes/tests.py
@@ -54,6 +54,12 @@ class DateTimesTests(TestCase):
],
)
self.assertSequenceEqual(
+ Comment.objects.datetimes("article__pub_date", "week"), [
+ datetime.datetime(2005, 7, 25),
+ datetime.datetime(2010, 7, 26),
+ ],
+ )
+ self.assertSequenceEqual(
Comment.objects.datetimes("article__pub_date", "day"), [
datetime.datetime(2005, 7, 28),
datetime.datetime(2010, 7, 28),
@@ -99,6 +105,9 @@ class DateTimesTests(TestCase):
Article.objects.datetimes('pub_date', 'month'),
["datetime.datetime(2005, 7, 1, 0, 0)"])
self.assertQuerysetEqual(
+ Article.objects.datetimes('pub_date', 'week'),
+ ["datetime.datetime(2005, 7, 25, 0, 0)"])
+ self.assertQuerysetEqual(
Article.objects.datetimes('pub_date', 'day'),
["datetime.datetime(2005, 7, 28, 0, 0)",
"datetime.datetime(2005, 7, 29, 0, 0)",