MCPcopy
hub / github.com/django/django / test_dates_avoid_datetime_cast

Method test_dates_avoid_datetime_cast

tests/dates/tests.py:135–142  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

133
134 @skipUnless(connection.vendor == "mysql", "Test checks MySQL query syntax")
135 def test_dates_avoid_datetime_cast(self):
136 Article.objects.create(pub_date=datetime.date(2015, 10, 21))
137 for kind in ["day", "month", "year"]:
138 qs = Article.objects.dates("pub_date", kind)
139 if kind == "day":
140 self.assertIn("DATE(", str(qs.query))
141 else:
142 self.assertIn(" AS DATE)", str(qs.query))

Callers

nothing calls this directly

Calls 2

datesMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected