diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-08-18 20:12:39 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-08-18 20:12:39 +0000 |
| commit | fc17f7e65933cc5b3329436a9dd5f28a094dcc7a (patch) | |
| tree | 99673e6ff5127a9586282137a4ec14d8d10df722 /test/sql/query.py | |
| parent | c48177f0fed3a43b3b8b02c18243cb1664ce0abb (diff) | |
| download | sqlalchemy-fc17f7e65933cc5b3329436a9dd5f28a094dcc7a.tar.gz | |
[ticket:280] statement execution supports using the same BindParam
object more than once in an expression; simplified handling of positional
parameters. nice job by Bill Noon figuring out the basic idea.
Diffstat (limited to 'test/sql/query.py')
| -rw-r--r-- | test/sql/query.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/sql/query.py b/test/sql/query.py index 2148aae67..ccb998e9e 100644 --- a/test/sql/query.py +++ b/test/sql/query.py @@ -115,6 +115,16 @@ class QueryTest(PersistTest): finally: test_table.drop() + def test_repeated_bindparams(self): + """test that a BindParam can be used more than once. + this should be run for dbs with both positional and named paramstyles.""" + self.users.insert().execute(user_id = 7, user_name = 'jack') + self.users.insert().execute(user_id = 8, user_name = 'fred') + + u = bindparam('uid') + s = self.users.select(or_(self.users.c.user_name==u, self.users.c.user_name==u)) + r = s.execute(uid='fred').fetchall() + assert len(r) == 1 def testdelete(self): self.users.insert().execute(user_id = 7, user_name = 'jack') |
