MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_clear_pk

Method test_clear_pk

test/orm/test_sync.py:141–154  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

139 eq_(b1.obj().__dict__["t1id"], None)
140
141 def test_clear_pk(self):
142 uowcommit, a1, b1, a_mapper, b_mapper = self._fixture()
143 pairs = [(a_mapper.c.id, b_mapper.c.id)]
144 b1.obj().id = 8
145 eq_(b1.obj().__dict__["id"], 8)
146 assert_raises_message(
147 AssertionError,
148 "Dependency rule on column 't1.id' tried to blank-out primary key "
149 "column 't2.id' on instance '<B",
150 sync._clear,
151 b1,
152 b_mapper,
153 pairs,
154 )
155
156 def test_clear_unmapped(self):
157 uowcommit, a1, b1, a_mapper, b_mapper = self._fixture()

Callers

nothing calls this directly

Calls 3

_fixtureMethod · 0.95
eq_Function · 0.90
assert_raises_messageFunction · 0.90

Tested by

no test coverage detected