From cd8b9dcd37e29b73a3c4b25adc16f1b45371fb7a Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 10 Sep 2012 12:58:11 -0400 Subject: - [feature] The cast() and extract() constructs will now be produced via the func.* accessor as well, as users naturally try to access these names from func.* they might as well do what's expected, even though the returned object is not a FunctionElement. [ticket:2562] --- test/sql/test_functions.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/sql/test_functions.py') diff --git a/test/sql/test_functions.py b/test/sql/test_functions.py index 8e5c6bc58..478f41381 100644 --- a/test/sql/test_functions.py +++ b/test/sql/test_functions.py @@ -289,6 +289,12 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): "WHERE users.id BETWEEN c1.z AND c2.z", checkparams={'y_1': 45, 'x_1': 17, 'y_2': 12, 'x_2': 5}) + def test_non_functions(self): + expr = func.cast("foo", Integer) + self.assert_compile(expr, "CAST(:param_1 AS INTEGER)") + + expr = func.extract("year", datetime.date(2010, 12, 5)) + self.assert_compile(expr, "EXTRACT(year FROM :param_1)") class ExecuteTest(fixtures.TestBase): @engines.close_first -- cgit v1.2.1