diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2020-06-29 19:04:32 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2020-06-29 19:04:32 +0000 |
commit | 0139afccaad036e60f0b9ee5db5b96ec7d15159f (patch) | |
tree | 1d34417536c2edbdda2455bcd1424511bd30bcb8 | |
parent | a2c2dcaf082ecf97c7e06cd23adf5a614b5a4a2b (diff) | |
parent | 0fd256d9937222ddf9f9d138641a59247ce0d450 (diff) | |
download | sqlalchemy-0139afccaad036e60f0b9ee5db5b96ec7d15159f.tar.gz |
Merge "Fixes: #4556 - Test that prevents passing a filter to Session.query when running an update"
-rw-r--r-- | test/orm/test_update_delete.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/orm/test_update_delete.py b/test/orm/test_update_delete.py index 310b17047..b0d718315 100644 --- a/test/orm/test_update_delete.py +++ b/test/orm/test_update_delete.py @@ -607,6 +607,19 @@ class UpdateDeleteTest(fixtures.MappedTest): in_(jill, sess) not_in_(jane, sess) + def test_update_with_filter_statement(self): + """test for [ticket:4556] """ + + User = self.classes.User + + sess = Session() + assert_raises( + exc.ArgumentError, + lambda: sess.query(User.name == "filter").update( + {"name": "update"} + ), + ) + def test_update_without_load(self): User = self.classes.User |