MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_object_set_none_expired

Method test_object_set_none_expired

test/orm/test_attributes.py:1867–1878  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1865 eq_(self._someattr_history(f), ([None], (), [b1]))
1866
1867 def test_object_set_none_expired(self):
1868 Foo, Bar = self._two_obj_fixture(uselist=False)
1869 f = Foo()
1870 b1 = Bar()
1871 f.someattr = b1
1872 self._commit_someattr(f)
1873
1874 attributes.instance_state(f).dict.pop("someattr", None)
1875 attributes.instance_state(f).expired_attributes.add("someattr")
1876
1877 f.someattr = None
1878 eq_(self._someattr_history(f), ([None], (), ()))
1879
1880 def test_object_del(self):
1881 Foo, Bar = self._two_obj_fixture(uselist=False)

Callers

nothing calls this directly

Calls 8

_two_obj_fixtureMethod · 0.95
_commit_someattrMethod · 0.95
_someattr_historyMethod · 0.95
eq_Function · 0.90
FooClass · 0.70
BarClass · 0.70
popMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected