diff options
author | Jason Kirtland <jek@discorporate.us> | 2008-07-24 21:36:16 +0000 |
---|---|---|
committer | Jason Kirtland <jek@discorporate.us> | 2008-07-24 21:36:16 +0000 |
commit | b403f156fedf7f1c3da34818f5ebe9debab481d7 (patch) | |
tree | ecdb6b4ba3832948c2d173b473934a6d4245c5b3 /test/sql/functions.py | |
parent | 951fe224fa5638e2c1c224f9ebfcaebb38e49922 (diff) | |
download | sqlalchemy-b403f156fedf7f1c3da34818f5ebe9debab481d7.tar.gz |
- func.count() with no argument emits COUNT(*)
Diffstat (limited to 'test/sql/functions.py')
-rw-r--r-- | test/sql/functions.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/sql/functions.py b/test/sql/functions.py index 6754d6d42..681d6a557 100644 --- a/test/sql/functions.py +++ b/test/sql/functions.py @@ -8,6 +8,7 @@ from sqlalchemy.engine import default from sqlalchemy import types as sqltypes from testlib import * from sqlalchemy.sql.functions import GenericFunction +from testlib.testing import eq_ from sqlalchemy.databases import * # every dialect in databases.__all__ is expected to pass these tests. @@ -68,6 +69,14 @@ class CompileTest(TestBase, AssertsCompiledSQL): ]: self.assert_compile(func.random(), ret, dialect=dialect) + def test_generic_count(self): + assert isinstance(func.count().type, sqltypes.Integer) + + self.assert_compile(func.count(), 'count(*)') + self.assert_compile(func.count(1), 'count(:param_1)') + c = column('abc') + self.assert_compile(func.count(c), 'count(abc)') + def test_constructor(self): try: func.current_timestamp('somearg') |