Basic common denominator execution tests for extract()
(self, connection)
| 1319 | assert x == y == z == w |
| 1320 | |
| 1321 | def test_extract_bind(self, connection): |
| 1322 | """Basic common denominator execution tests for extract()""" |
| 1323 | |
| 1324 | date = datetime.date(2010, 5, 1) |
| 1325 | |
| 1326 | def execute(field): |
| 1327 | return connection.execute(select(extract(field, date))).scalar() |
| 1328 | |
| 1329 | assert execute("year") == 2010 |
| 1330 | assert execute("month") == 5 |
| 1331 | assert execute("day") == 1 |
| 1332 | |
| 1333 | date = datetime.datetime(2010, 5, 1, 12, 11, 10) |
| 1334 | |
| 1335 | assert execute("year") == 2010 |
| 1336 | assert execute("month") == 5 |
| 1337 | assert execute("day") == 1 |
| 1338 | |
| 1339 | @testing.provide_metadata |
| 1340 | def test_extract_expression(self, connection): |