def test_source_modified_modified(self): uowcommit, a1, b1, a_mapper, b_mapper = self._fixture() a1.obj().id = 10 a1._commit_all(a1.dict) a1.obj().id = 12 pairs = [(a_mapper.c.id, b_mapper.c.id)] eq_(sync.source_modified(uowcommit, a1, a_mapper, pairs), True)
def test_source_modified_unmodified(self): uowcommit, a1, b1, a_mapper, b_mapper = self._fixture() a1.obj().id = 10 pairs = [(a_mapper.c.id, b_mapper.c.id,)] eq_( sync.source_modified(uowcommit, a1, a_mapper, pairs), False )
def test_source_modified_unmodified(self): uowcommit, a1, b1, a_mapper, b_mapper = self._fixture() a1.obj().id = 10 pairs = [( a_mapper.c.id, b_mapper.c.id, )] eq_(sync.source_modified(uowcommit, a1, a_mapper, pairs), False)
def test_source_modified_composite_unmodified(self): uowcommit, a1, b1, a_mapper, b_mapper = self._fixture() a1.obj().foo = 10 a1._commit_all(a1.dict) pairs = [ (a_mapper.c.id, b_mapper.c.id), (a_mapper.c.foo, b_mapper.c.id), ] eq_(sync.source_modified(uowcommit, a1, a_mapper, pairs), False)
def test_source_modified_modified(self): uowcommit, a1, b1, a_mapper, b_mapper = self._fixture() a1.obj().id = 10 a1.commit_all(a1.dict) a1.obj().id = 12 pairs = [(a_mapper.c.id, b_mapper.c.id,)] eq_( sync.source_modified(uowcommit, a1, a_mapper, pairs), True )
def test_source_modified_composite_unmodified(self): uowcommit, a1, b1, a_mapper, b_mapper = self._fixture() a1.obj().foo = 10 a1._commit_all(a1.dict) pairs = [(a_mapper.c.id, b_mapper.c.id,), (a_mapper.c.foo, b_mapper.c.id)] eq_( sync.source_modified(uowcommit, a1, a_mapper, pairs), False )
def _pks_changed(self, uowcommit, state): return bool(state.key) and sync.source_modified(uowcommit, state, self.mapper, self.prop.synchronize_pairs)
def _pks_changed(self, uowcommit, state): return sync.source_modified( uowcommit, state, self.parent, self.prop.synchronize_pairs)
def _pks_changed(self, uowcommit, state): return sync.source_modified(uowcommit, state, self.parent, self.prop.synchronize_pairs)
def _pks_changed(self, uowcommit, state): return state.has_identity and sync.source_modified( uowcommit, state, self.mapper, self.prop.synchronize_pairs)
def test_source_modified_no_pairs(self): uowcommit, a1, b1, a_mapper, b_mapper = self._fixture() eq_( sync.source_modified(uowcommit, a1, a_mapper, []), False )
def _pks_changed(self, uowcommit, state): return state.has_identity and sync.source_modified(uowcommit, state, self.mapper, self.prop.synchronize_pairs)
def test_source_modified_no_pairs(self): uowcommit, a1, b1, a_mapper, b_mapper = self._fixture() eq_(sync.source_modified(uowcommit, a1, a_mapper, []), False)