diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-09-08 21:34:39 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-09-08 21:41:13 -0400 |
commit | 70be7312f10a2241cde3e6472af15ef5a9ae222a (patch) | |
tree | 7e7e28baf1a5fc7d2d07c6249b2b177abe770ef8 /test/dialect/mysql/test_on_duplicate.py | |
parent | 5ae984b946f87cc485c29c4c947a8649d4c4c422 (diff) | |
download | sqlalchemy-70be7312f10a2241cde3e6472af15ef5a9ae222a.tar.gz |
Rename MySQL dml.insert().values to .inserted
Changed the name of the ``.values`` attribute of the new MySQL
INSERT..ON DUPLICATE KEY UPDATE construct to ``.inserted``, as
:class:`.Insert` already has a method called :meth:`.Insert.values`.
The ``.inserted`` attribute ultimately renders the MySQL ``VALUES()``
function.
Change-Id: I8da8e30a3077698385a4b77e2c2032e2d1ff10b2
Fixes: #4072
Diffstat (limited to 'test/dialect/mysql/test_on_duplicate.py')
-rw-r--r-- | test/dialect/mysql/test_on_duplicate.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/dialect/mysql/test_on_duplicate.py b/test/dialect/mysql/test_on_duplicate.py index 2ff4a58cc..9a026f9ed 100644 --- a/test/dialect/mysql/test_on_duplicate.py +++ b/test/dialect/mysql/test_on_duplicate.py @@ -29,8 +29,9 @@ class OnDuplicateTest(fixtures.TablesTest): foos = self.tables.foos with testing.db.connect() as conn: conn.execute(insert(foos, dict(id=1, bar='b', baz='bz'))) - stmt = insert(foos, [dict(id=1, bar='ab'), dict(id=2, bar='b')]) - stmt = stmt.on_duplicate_key_update(bar=stmt.values.bar) + stmt = insert(foos).values( + [dict(id=1, bar='ab'), dict(id=2, bar='b')]) + stmt = stmt.on_duplicate_key_update(bar=stmt.inserted.bar) result = conn.execute(stmt) eq_(result.inserted_primary_key, [2]) eq_( @@ -41,17 +42,17 @@ class OnDuplicateTest(fixtures.TablesTest): def test_last_inserted_id(self): foos = self.tables.foos with testing.db.connect() as conn: - stmt = insert(foos, {"bar": "b", "baz": "bz"}) + stmt = insert(foos).values({"bar": "b", "baz": "bz"}) result = conn.execute( stmt.on_duplicate_key_update( - bar=stmt.values.bar, baz="newbz") + bar=stmt.inserted.bar, baz="newbz") ) eq_(result.inserted_primary_key, [1]) - stmt = insert(foos, {"id": 1, "bar": "b", "baz": "bz"}) + stmt = insert(foos).values({"id": 1, "bar": "b", "baz": "bz"}) result = conn.execute( stmt.on_duplicate_key_update( - bar=stmt.values.bar, baz="newbz") + bar=stmt.inserted.bar, baz="newbz") ) eq_(result.inserted_primary_key, [1]) |