summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-06-23 18:38:23 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-06-23 18:42:54 -0400
commit7e7447db1ff1a49f15269f6515a82607db9384f4 (patch)
treed2add8806d34cf646e03f3a269be6fc29ef17054
parentea54b635d66bc695c5149ede5279cc6ee2f43e7c (diff)
downloadsqlalchemy-7e7447db1ff1a49f15269f6515a82607db9384f4.tar.gz
- Reverted the change for :ticket:`3060` - this is a unit of work
fix that is updated more comprehensively in 1.0 via :ticket:`3061`. The fix in :ticket:`3060` unfortunately produces a new issue whereby an eager load of a many-to-one attribute can produce an event that is interpreted into an attribute change.
-rw-r--r--doc/build/changelog/changelog_09.rst20
-rw-r--r--lib/sqlalchemy/testing/__init__.py2
-rw-r--r--test/orm/test_unitofworkv2.py21
3 files changed, 42 insertions, 1 deletions
diff --git a/doc/build/changelog/changelog_09.rst b/doc/build/changelog/changelog_09.rst
index 832b067dd..adc109680 100644
--- a/doc/build/changelog/changelog_09.rst
+++ b/doc/build/changelog/changelog_09.rst
@@ -12,6 +12,20 @@
:start-line: 5
.. changelog::
+ :version: 0.9.6
+ :released:
+
+ .. change::
+ :tags: bug, orm
+ :tickets: 3060
+
+ Reverted the change for :ticket:`3060` - this is a unit of work
+ fix that is updated more comprehensively in 1.0 via :ticket:`3061`.
+ The fix in :ticket:`3060` unfortunately produces a new issue whereby
+ an eager load of a many-to-one attribute can produce an event
+ that is interpreted into an attribute change.
+
+.. changelog::
:version: 0.9.5
:released: June 23, 2014
@@ -137,6 +151,12 @@
which reverts the more patchwork version of the fix as it exists
in 0.9.5.
+ .. note::
+
+ This change has been **REVERTED** in 0.9.6. The full fix
+ will be in version 1.0 of SQLAlchemy.
+
+
.. change::
:tags: bug, orm
:versions: 1.0.0
diff --git a/lib/sqlalchemy/testing/__init__.py b/lib/sqlalchemy/testing/__init__.py
index 954906432..c03c6f349 100644
--- a/lib/sqlalchemy/testing/__init__.py
+++ b/lib/sqlalchemy/testing/__init__.py
@@ -11,7 +11,7 @@ from . import config
from .exclusions import db_spec, _is_excluded, fails_if, skip_if, future,\
fails_on, fails_on_everything_except, skip, only_on, exclude, \
- against as _against, _server_version, only_if
+ against as _against, _server_version, only_if, fails
def against(*queries):
diff --git a/test/orm/test_unitofworkv2.py b/test/orm/test_unitofworkv2.py
index 00cc044bf..787c104e7 100644
--- a/test/orm/test_unitofworkv2.py
+++ b/test/orm/test_unitofworkv2.py
@@ -1314,6 +1314,7 @@ class RowswitchM2OTest(fixtures.MappedTest):
mapper(C, c)
return A, B, C
+ @testing.fails()
def test_set_none_replaces_m2o(self):
# we have to deal here with the fact that a
# get of an unset attribute implicitly sets it to None
@@ -1337,6 +1338,7 @@ class RowswitchM2OTest(fixtures.MappedTest):
sess.commit()
assert a1.bs[0].c is None
+ @testing.fails()
def test_set_none_w_get_replaces_m2o(self):
A, B, C = self._fixture()
sess = Session()
@@ -1389,6 +1391,25 @@ class RowswitchM2OTest(fixtures.MappedTest):
sess.commit()
assert a1.bs[0].data is None
+ def test_joinedload_doesnt_produce_bogus_event(self):
+ A, B, C = self._fixture()
+ sess = Session()
+
+ c1 = C()
+ sess.add(c1)
+ sess.flush()
+
+ b1 = B()
+ sess.add(b1)
+ sess.commit()
+
+ # test that was broken by #3060
+ from sqlalchemy.orm import joinedload
+ b1 = sess.query(B).options(joinedload("c")).first()
+ b1.cid = c1.id
+ sess.flush()
+
+ assert b1.cid == c1.id
class BasicStaleChecksTest(fixtures.MappedTest):