MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / setUp

Method setUp

apps/output/tests.py:45–64  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

43 """Isolate HTTP endpoint tests from network ACL, logging, DB teardown, and Redis."""
44
45 def setUp(self):
46 super().setUp()
47 self._network_patch = patch(
48 "apps.output.views.network_access_allowed",
49 return_value=True,
50 )
51 self._epg_teardown_patch = patch("apps.output.epg._epg_export_teardown")
52 self._log_event_patch = patch("apps.output.views.log_system_event")
53 self._epg_log_event_patch = patch("apps.output.epg.log_system_event")
54 self._close_db_patch = patch("django.db.close_old_connections")
55 self._epg_cache_patch = patch(
56 "apps.output.epg.stream_cached_response",
57 side_effect=_epg_response_without_redis,
58 )
59 self._network_patch.start()
60 self._epg_teardown_patch.start()
61 self._log_event_patch.start()
62 self._epg_log_event_patch.start()
63 self._close_db_patch.start()
64 self._epg_cache_patch.start()
65
66 def tearDown(self):
67 from django.core.cache import cache

Callers

nothing calls this directly

Calls 2

setUpMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected