mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #28650 -- Added TruncWeek database function.
This commit is contained in:
committed by
Tim Graham
parent
f229049d6c
commit
a455e732a0
@@ -53,6 +53,12 @@ class DateTimesTests(TestCase):
|
||||
datetime.datetime(2010, 7, 1),
|
||||
],
|
||||
)
|
||||
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),
|
||||
@@ -98,6 +104,9 @@ class DateTimesTests(TestCase):
|
||||
self.assertQuerysetEqual(
|
||||
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)",
|
||||
|
||||
Reference in New Issue
Block a user