Ejemplo n.º 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, [])
Ejemplo n.º 2
0
 def test_pop_items_messages(self):
     self.request.session.update({"items_messages": ["test"]})
     messages_system = MessagesSystem(self.request)
     message = messages_system.pop_items()
     self.assertEqual(self.request.session.get("items_messages"), [])
     self.assertEqual(message, ["test"])