Basic common denominator execution tests for extract()
(self, connection)
| 1654 | assert x == y == z == w |
| 1655 | |
| 1656 | def test_extract_bind(self, connection): |
| 1657 | """Basic common denominator execution tests for extract()""" |
| 1658 | |
| 1659 | date = datetime.date(2010, 5, 1) |
| 1660 | |
| 1661 | def execute(field): |
| 1662 | return connection.execute(select(extract(field, date))).scalar() |
| 1663 | |
| 1664 | assert execute("year") == 2010 |
| 1665 | assert execute("month") == 5 |
| 1666 | assert execute("day") == 1 |
| 1667 | |
| 1668 | date = datetime.datetime(2010, 5, 1, 12, 11, 10) |
| 1669 | |
| 1670 | assert execute("year") == 2010 |
| 1671 | assert execute("month") == 5 |
| 1672 | assert execute("day") == 1 |
| 1673 | |
| 1674 | @testing.provide_metadata |
| 1675 | def test_extract_expression(self, connection): |