| 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 |