mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #28650 -- Added TruncWeek database function.
This commit is contained in:
parent
f229049d6c
commit
a455e732a0
12 changed files with 116 additions and 16 deletions
|
@ -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)",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue