def test_clear_cache_all_caches( self, clear_singleton_cache, clear_memo_cache, clear_legacy_cache ): rs = ReportSession(MagicMock(), "", "", UploadedFileManager(), None) rs.handle_clear_cache_request() clear_singleton_cache.assert_called_once() clear_memo_cache.assert_called_once() clear_legacy_cache.assert_called_once()
def test_clear_cache_resets_session_state(self, _1): rs = ReportSession(None, "", "", UploadedFileManager(), None) rs._session_state["foo"] = "bar" rs.handle_clear_cache_request() self.assertTrue("foo" not in rs._session_state)