MCPcopy
hub / github.com/django/django / test_close

Method test_close

tests/cache/tests.py:1677–1688  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1675 self.assertTrue(value is None or value == large_value)
1676
1677 def test_close(self):
1678 # For clients that don't manage their connections properly, the
1679 # connection is closed when the request is complete.
1680 signals.request_finished.disconnect(close_old_connections)
1681 try:
1682 with mock.patch.object(
1683 cache._class, "disconnect_all", autospec=True
1684 ) as mock_disconnect:
1685 signals.request_finished.send(self.__class__)
1686 self.assertIs(mock_disconnect.called, self.should_disconnect_on_close)
1687 finally:
1688 signals.request_finished.connect(close_old_connections)
1689
1690 def test_set_many_returns_failing_keys(self):
1691 def fail_set_multi(mapping, *args, **kwargs):

Callers

nothing calls this directly

Calls 3

disconnectMethod · 0.45
sendMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected