diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-06-03 10:08:33 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-06-03 10:08:33 -0400 |
| commit | 47d29eae8fa14ab7b1aab63797860a475338f950 (patch) | |
| tree | 47a386c0fa1a32e455ea72cfad46cb4a59df8446 /test/ext | |
| parent | 36d2b40cf55bc0f4e850e9ec4e905f0051f573f2 (diff) | |
| download | sqlalchemy-47d29eae8fa14ab7b1aab63797860a475338f950.tar.gz | |
- changelog for pr bitbucket:54
- alter the approach so that the initial callable is working just like add_criteria/with_criteria
Diffstat (limited to 'test/ext')
| -rw-r--r-- | test/ext/test_baked.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ext/test_baked.py b/test/ext/test_baked.py index 92ce45c3f..78c43fc7e 100644 --- a/test/ext/test_baked.py +++ b/test/ext/test_baked.py @@ -242,6 +242,26 @@ class ResultTest(BakedTest): }) mapper(Address, cls.tables.addresses) + def test_cachekeys_on_constructor(self): + User = self.classes.User + + queue = [7, 8] + fn = lambda s: s.query(User.id).filter_by(id=queue.pop(0)) + bq1 = self.bakery(fn, 7) + bq2 = self.bakery(fn, 8) + + for i in range(3): + session = Session(autocommit=True) + eq_( + bq1(session).all(), + [(7,)] + ) + + eq_( + bq2(session).all(), + [(8,)] + ) + def test_no_steps(self): User = self.classes.User |
