MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_delete_twice

Method test_delete_twice

test/orm/test_unitofworkv2.py:1914–1931  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1912
1913 @testing.requires.sane_rowcount
1914 def test_delete_twice(self):
1915 Parent, Child = self._fixture()
1916 sess = fixture_session()
1917 p1 = Parent(id=1, data=2, child=None)
1918 sess.add(p1)
1919 sess.commit()
1920
1921 sess.delete(p1)
1922 sess.flush()
1923
1924 sess.delete(p1)
1925
1926 assert_warns_message(
1927 exc.SAWarning,
1928 r"DELETE statement on table 'parent' expected to "
1929 r"delete 1 row\(s\); 0 were matched.",
1930 sess.commit,
1931 )
1932
1933 @testing.requires.sane_multi_rowcount
1934 def test_delete_multi_missing_warning(self):

Callers

nothing calls this directly

Calls 8

_fixtureMethod · 0.95
fixture_sessionFunction · 0.90
assert_warns_messageFunction · 0.90
ParentClass · 0.70
addMethod · 0.45
commitMethod · 0.45
deleteMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected