def test_load_on_pending_disallows_backref_event(self):
        Child.parent.property.load_on_pending = True
        sess.autoflush = False
        c3 = Child()
        sess.add(c3)
        c3.parent_id = p1.id
        c3.parent = p1

        # a side effect of load-on-pending with no autoflush.
        # a change to the backref event handler to check
        # collection membership before assuming "old == new so return"
        # would fix this - but this is wasteful and autoflush
        # should be turned on.
        assert c3 not in p1.children
dataset/ETHPy150Open zzzeek/sqlalchemy/test/orm/test_load_on_fks.py/LoadOnFKsTest.test_load_on_pending_disallows_backref_event/original