MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _test_attribute

Method _test_attribute

test/orm/test_relationships.py:6112–6124  ·  view source on GitHub ↗
(self, obj, attrname, newvalue)

Source from the content-addressed store, hash-verified

6110 run_deletes = None
6111
6112 def _test_attribute(self, obj, attrname, newvalue):
6113 sess = fixture_session()
6114 sess.add(obj)
6115 oldvalue = getattr(obj, attrname)
6116 sess.commit()
6117
6118 # expired
6119 assert attrname not in obj.__dict__
6120
6121 setattr(obj, attrname, newvalue)
6122 eq_(
6123 attributes.get_history(obj, attrname), ([newvalue], (), [oldvalue])
6124 )
6125
6126 def test_column_property_flag(self):
6127 User, users = self.classes.User, self.tables.users

Calls 5

fixture_sessionFunction · 0.90
eq_Function · 0.90
addMethod · 0.45
commitMethod · 0.45
get_historyMethod · 0.45

Tested by

no test coverage detected