summaryrefslogtreecommitdiff
path: root/tests/db_functions/datetime
diff options
context:
space:
mode:
authorDavid-Wobrock <david.wobrock@gmail.com>2020-10-14 09:55:27 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-10-14 20:03:44 +0200
commit8d018231ac64c044c9740b79c0acf6d0abd7c513 (patch)
treec963f77a3a38fae3bd2c45d67051051f24047dec /tests/db_functions/datetime
parenta0571c1003c5a312a6a2ce7409799d77f2d95025 (diff)
Removed redundant tests in test_extract_trunc.
tzinfo is ignored for DateFields and TimeFields, and it's already covered by DateFunctionTests.test_trunc_func().
Diffstat (limited to 'tests/db_functions/datetime')
-rw-r--r--tests/db_functions/datetime/test_extract_trunc.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/tests/db_functions/datetime/test_extract_trunc.py b/tests/db_functions/datetime/test_extract_trunc.py
index a842eb9418..58ca9b52b5 100644
--- a/tests/db_functions/datetime/test_extract_trunc.py
+++ b/tests/db_functions/datetime/test_extract_trunc.py
@@ -1205,38 +1205,6 @@ class DateFunctionWithTimeZoneTests(DateFunctionTests):
lambda m: (m.start_datetime, m.truncated)
)
- def test_date_kind(kind):
- self.assertQuerysetEqual(
- DTModel.objects.annotate(
- truncated=Trunc('start_date', kind, output_field=DateField(), tzinfo=melb)
- ).order_by('start_datetime'),
- [
- (start_datetime, truncate_to(start_datetime.date(), kind)),
- (end_datetime, truncate_to(end_datetime.date(), kind))
- ],
- lambda m: (m.start_datetime, m.truncated)
- )
-
- def test_time_kind(kind):
- self.assertQuerysetEqual(
- DTModel.objects.annotate(
- truncated=Trunc('start_time', kind, output_field=TimeField(), tzinfo=melb)
- ).order_by('start_datetime'),
- [
- (start_datetime, truncate_to(start_datetime.time(), kind)),
- (end_datetime, truncate_to(end_datetime.time(), kind))
- ],
- lambda m: (m.start_datetime, m.truncated)
- )
-
- test_date_kind('year')
- test_date_kind('quarter')
- test_date_kind('month')
- test_date_kind('week')
- test_date_kind('day')
- test_time_kind('hour')
- test_time_kind('minute')
- test_time_kind('second')
test_datetime_kind('year')
test_datetime_kind('quarter')
test_datetime_kind('month')