MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _test_update_states

Method _test_update_states

test/orm/dml/test_bulk.py:618–632  ·  view source on GitHub ↗
(self, person_cls)

Source from the content-addressed store, hash-verified

616 return asserter
617
618 def _test_update_states(self, person_cls):
619 Person = person_cls
620
621 s = fixture_session()
622 s.add(Person(id=5, personname="thename"))
623 s.commit()
624
625 p = s.get(Person, 5)
626 with self.sql_execution_asserter(testing.db) as asserter:
627 p.personname = "newname"
628 s.bulk_save_objects([p])
629
630 eq_(s.query(Person).first(), Person(id=5, personname="newname"))
631
632 return asserter
633
634
635class BulkInheritanceTest(BulkTest, fixtures.MappedTest):

Callers 2

test_update_keysMethod · 0.95
test_update_attrsMethod · 0.95

Calls 10

fixture_sessionFunction · 0.90
eq_Function · 0.90
PersonClass · 0.70
addMethod · 0.45
commitMethod · 0.45
getMethod · 0.45
bulk_save_objectsMethod · 0.45
firstMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected