MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_object_del_expired

Method test_object_del_expired

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

Source from the content-addressed store, hash-verified

1889 eq_(self._someattr_history(f), ((), (), [b1]))
1890
1891 def test_object_del_expired(self):
1892 Foo, Bar = self._two_obj_fixture(uselist=False)
1893 f = Foo()
1894 b1 = Bar()
1895 f.someattr = b1
1896 self._commit_someattr(f)
1897
1898 # the "delete" handler checks if the object
1899 # is db-loaded when testing if an empty "del" is valid,
1900 # because there's nothing else to look at for a related
1901 # object, there's no "expired" status
1902 attributes.instance_state(f).key = ("foo",)
1903 attributes.instance_state(f)._expire_attributes(
1904 attributes.instance_dict(f), ["someattr"]
1905 )
1906
1907 del f.someattr
1908 eq_(self._someattr_history(f), ([None], (), ()))
1909
1910 def test_scalar_no_init_side_effect(self):
1911 Foo = self._fixture(

Callers

nothing calls this directly

Calls 7

_two_obj_fixtureMethod · 0.95
_commit_someattrMethod · 0.95
_someattr_historyMethod · 0.95
eq_Function · 0.90
_expire_attributesMethod · 0.80
FooClass · 0.70
BarClass · 0.70

Tested by

no test coverage detected