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.
.. include:: changelog_07.rst
: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
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
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):
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
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()
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):