diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-26 18:01:21 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-26 18:01:21 -0400 |
commit | c7ceb00792bb0d22c02887021115f0f607bf07ec (patch) | |
tree | 2e35149c11706732a8007abc9563b13beaa92d83 /test/sql/test_functions.py | |
parent | b0e0bbb816b578910d0e08f034a732fc5fc898fd (diff) | |
download | sqlalchemy-c7ceb00792bb0d22c02887021115f0f607bf07ec.tar.gz |
- add "identifier", can differentiate between "name" rendered and "identifier" in func.
Diffstat (limited to 'test/sql/test_functions.py')
-rw-r--r-- | test/sql/test_functions.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/sql/test_functions.py b/test/sql/test_functions.py index fc227f375..f0fcd4b72 100644 --- a/test/sql/test_functions.py +++ b/test/sql/test_functions.py @@ -127,6 +127,35 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): "my_func(:param_1, :param_2, :param_3)" ) + def test_custom_registered_identifier(self): + class GeoBuffer(GenericFunction): + type = Integer + package = "geo" + name = "BufferOne" + identifier = "buf1" + + class GeoBuffer2(GenericFunction): + type = Integer + name = "BufferTwo" + identifier = "buf2" + + class BufferThree(GenericFunction): + type = Integer + identifier = "buf3" + + self.assert_compile( + func.geo.buf1(), + "BufferOne()" + ) + self.assert_compile( + func.buf2(), + "BufferTwo()" + ) + self.assert_compile( + func.buf3(), + "BufferThree()" + ) + def test_custom_args(self): class myfunc(GenericFunction): pass |