| 1338 | ) |
| 1339 | |
| 1340 | def test_extract(self, connection): |
| 1341 | fivedaysago = connection.execute( |
| 1342 | select(func.now().op("at time zone")("UTC")) |
| 1343 | ).scalar() - datetime.timedelta(days=5) |
| 1344 | |
| 1345 | for field, exp in ( |
| 1346 | ("year", fivedaysago.year), |
| 1347 | ("month", fivedaysago.month), |
| 1348 | ("day", fivedaysago.day), |
| 1349 | ): |
| 1350 | r = connection.execute( |
| 1351 | select( |
| 1352 | extract( |
| 1353 | field, |
| 1354 | func.now().op("at time zone")("UTC") |
| 1355 | + datetime.timedelta(days=-5), |
| 1356 | ) |
| 1357 | ) |
| 1358 | ).scalar() |
| 1359 | eq_(r, exp) |
| 1360 | |
| 1361 | @testing.provide_metadata |
| 1362 | def test_checksfor_sequence(self, connection): |