MCPcopy
hub / github.com/django/django / test_pre_callback

Method test_pre_callback

tests/test_utils/tests.py:2120–2129  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2118 self.assertIs(self.callback_called, True)
2119
2120 def test_pre_callback(self):
2121 def pre_hook():
2122 pass
2123
2124 transaction.on_commit(pre_hook, using="default")
2125 with self.captureOnCommitCallbacks() as callbacks:
2126 self.enqueue_callback()
2127
2128 self.assertEqual(len(callbacks), 1)
2129 self.assertNotEqual(callbacks[0], pre_hook)
2130
2131 @skipUnlessDBFeature("uses_savepoints")
2132 def test_with_rolled_back_savepoint(self):

Callers

nothing calls this directly

Calls 3

enqueue_callbackMethod · 0.95
on_commitMethod · 0.45

Tested by

no test coverage detected