示例#1
0
    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, [])
示例#2
0
 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"])