diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-02-14 18:22:47 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-02-14 18:22:47 +0000 |
| commit | 84485fb7bbc31ecc20176c088af671b2c27311bc (patch) | |
| tree | 7cbfaf85175ca0e318d6f5f47382f540a6317af4 /test/sql/query.py | |
| parent | eddae08fdfbae0f43c7355896604c455f576ca7e (diff) | |
| download | sqlalchemy-84485fb7bbc31ecc20176c088af671b2c27311bc.tar.gz | |
- fixed bug in result proxy where anonymously generated
column labels would not be accessible using their straight
string name
Diffstat (limited to 'test/sql/query.py')
| -rw-r--r-- | test/sql/query.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/test/sql/query.py b/test/sql/query.py index 533f40fb5..2cc4ab0d0 100644 --- a/test/sql/query.py +++ b/test/sql/query.py @@ -129,15 +129,29 @@ class QueryTest(TestBase): table.drop() def test_row_iteration(self): - users.insert().execute(user_id = 7, user_name = 'jack') - users.insert().execute(user_id = 8, user_name = 'ed') - users.insert().execute(user_id = 9, user_name = 'fred') + users.insert().execute( + {'user_id':7, 'user_name':'jack'}, + {'user_id':8, 'user_name':'ed'}, + {'user_id':9, 'user_name':'fred'}, + ) r = users.select().execute() l = [] for row in r: l.append(row) self.assert_(len(l) == 3) + def test_anonymous_rows(self): + users.insert().execute( + {'user_id':7, 'user_name':'jack'}, + {'user_id':8, 'user_name':'ed'}, + {'user_id':9, 'user_name':'fred'}, + ) + + sel = select([users.c.user_id]).where(users.c.user_name=='jack').as_scalar() + for row in select([sel + 1, sel + 3], bind=users.bind).execute(): + assert row['anon_1'] == 8 + assert row['anon_2'] == 10 + def test_row_comparison(self): users.insert().execute(user_id = 7, user_name = 'jack') rp = users.select().execute().fetchone() |
