diff options
Diffstat (limited to 'test/sql/test_lambdas.py')
| -rw-r--r-- | test/sql/test_lambdas.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/sql/test_lambdas.py b/test/sql/test_lambdas.py index fcf024182..24a83c9ee 100644 --- a/test/sql/test_lambdas.py +++ b/test/sql/test_lambdas.py @@ -1453,6 +1453,17 @@ class LambdaElementTest( is_(expr1._generate_cache_key().bindparams[0], expr1._resolved.right) is_(expr2._generate_cache_key().bindparams[0], expr2._resolved.right) + def test_cache_key_bindparam_matches_annotations(self): + t1 = table("t1", column("q"), column("p")) + + def go(): + expr = sql_util._deep_annotate((t1.c.q == 5), {"foo": "bar"}) + stmt = coercions.expect(roles.WhereHavingRole, lambda: expr) + return stmt + + self.assert_compile(go(), "t1.q = :q_1", checkparams={"q_1": 5}) + self.assert_compile(go(), "t1.q = :q_1", checkparams={"q_1": 5}) + def test_cache_key_instance_variable_issue_incorrect(self): t1 = table("t1", column("q"), column("p")) |
