def test_can_handle_missing_keys(self): message_system = MessagesSystem(self.request) item_message = message_system.pop_items() plugin_message = message_system.pop_plugins() skills_message = message_system.pop_skills() self.assertEqual(item_message, []) self.assertEqual(plugin_message, []) self.assertEqual(skills_message, [])
def test_pop_plugins_messages(self): self.request.session.update({"plugins_messages": ["test"]}) messages_system = MessagesSystem(self.request) message = messages_system.pop_plugins() self.assertEqual(self.request.session.get("plugins_messages"), []) self.assertEqual(message, ["test"])