MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_mark_dirty_no_attr

Method test_mark_dirty_no_attr

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

Source from the content-addressed store, hash-verified

2337 )
2338
2339 def test_mark_dirty_no_attr(self):
2340 Foo = self._fixture(
2341 uselist=False, useobject=False, active_history=False
2342 )
2343 f = Foo()
2344 f.someattr = "foo"
2345 attributes.instance_state(f)._commit_all(f.__dict__)
2346 eq_(self._someattr_history(f), ((), ["foo"], ()))
2347
2348 attributes.instance_state(f)._expire_attributes(
2349 attributes.instance_dict(f), ["someattr"]
2350 )
2351
2352 is_false(attributes.instance_state(f).modified)
2353
2354 attributes.flag_dirty(f)
2355
2356 is_true(attributes.instance_state(f).modified)
2357
2358 def test_use_object_init(self):
2359 Foo, Bar = self._two_obj_fixture(uselist=False)

Callers

nothing calls this directly

Calls 8

_fixtureMethod · 0.95
_someattr_historyMethod · 0.95
eq_Function · 0.90
is_falseFunction · 0.90
is_trueFunction · 0.90
_commit_allMethod · 0.80
_expire_attributesMethod · 0.80
FooClass · 0.70

Tested by

no test coverage detected