diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-12-22 10:36:55 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-12-22 10:36:55 -0500 |
| commit | efbbe88705eb19d68b587aae6dfb60cfe4356edb (patch) | |
| tree | e6467f4cc3121afe91fa1aa81cb02f9a0902a3e0 /test/orm/test_dynamic.py | |
| parent | 3522785ef493a6cad6403b4c702bbfe2f1b7dc89 (diff) | |
| download | sqlalchemy-efbbe88705eb19d68b587aae6dfb60cfe4356edb.tar.gz | |
- revert the full iteration of the collection for a passive history event; that's
the wrong behavior, and for the original #2637 issue we will have to fix the
association proxy, which is #2642
Diffstat (limited to 'test/orm/test_dynamic.py')
| -rw-r--r-- | test/orm/test_dynamic.py | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/test/orm/test_dynamic.py b/test/orm/test_dynamic.py index 0eef8f5a5..076ef8126 100644 --- a/test/orm/test_dynamic.py +++ b/test/orm/test_dynamic.py @@ -656,16 +656,19 @@ class HistoryTest(_DynamicFixture, _fixtures.FixtureTest): s.flush() return u1, a1, s - def _assert_history(self, obj, compare): + def _assert_history(self, obj, compare, compare_passive=None): eq_( attributes.get_history(obj, 'addresses'), compare ) + if compare_passive is None: + compare_passive = compare + eq_( attributes.get_history(obj, 'addresses', attributes.LOAD_AGAINST_COMMITTED), - compare + compare_passive ) def test_append_transient(self): @@ -719,7 +722,8 @@ class HistoryTest(_DynamicFixture, _fixtures.FixtureTest): u1.addresses.remove(a2) self._assert_history(u1, - ([a3], [a1], [a2]) + ([a3], [a1], [a2]), + compare_passive=([a3], [], [a2]) ) def test_replace_transient(self): @@ -767,7 +771,8 @@ class HistoryTest(_DynamicFixture, _fixtures.FixtureTest): u1.addresses = [a2, a3, a4, a5] self._assert_history(u1, - ([a3, a4, a5], [a2], [a1]) + ([a3, a4, a5], [a2], [a1]), + compare_passive=([a3, a4, a5], [], [a1]) ) @@ -778,7 +783,10 @@ class HistoryTest(_DynamicFixture, _fixtures.FixtureTest): u1.addresses.append(a1) - self._assert_history(u1, ([], [a1], [])) + self._assert_history(u1, + ([], [a1], []), + compare_passive=([a1], [], []) + ) def test_persistent_but_readded_autoflush(self): u1, a1, s = self._persistent_fixture(autoflush=True) @@ -787,11 +795,17 @@ class HistoryTest(_DynamicFixture, _fixtures.FixtureTest): u1.addresses.append(a1) - self._assert_history(u1, ([], [a1], [])) + self._assert_history(u1, + ([], [a1], []), + compare_passive=([a1], [], []) + ) def test_missing_but_removed_noflush(self): u1, a1, s = self._persistent_fixture(autoflush=False) u1.addresses.remove(a1) - self._assert_history(u1, ([], [], [])) + self._assert_history(u1, + ([], [], []), + compare_passive=([], [], [a1]) + ) |
