Esempio n. 1
0
 def test_append_message_dont_override_older_messages(self):
     self.request.session.update({"plugins_messages": ["test01"]})
     message_system = MessagesSystem(self.request)
     message_system._append_message("plugins_messages", "test")
     self.assertEqual(self.request.session.get("plugins_messages"),
                      ["test01", "test"])
     message_system._append_message("plugins_messages", ["other_test"])
     self.assertEqual(self.request.session.get("plugins_messages"),
                      ["test01", "test", "other_test"])
Esempio n. 2
0
 def test_append_message_can_handle_list(self):
     message_system = MessagesSystem(self.request)
     message_system._append_message("plugins_messages", ["test_02"])
     self.assertEqual(self.request.session.get("plugins_messages"),
                      ["test_02"])
Esempio n. 3
0
 def test_append_message_can_handle_nested_list(self):
     message_system = MessagesSystem(self.request)
     message_system._append_message("items_messages",
                                    [[["test"]], "test02"])
     self.assertEqual(self.request.session.get("items_messages"),
                      ["test", "test02"])
Esempio n. 4
0
 def test_append_message(self):
     message_system = MessagesSystem(self.request)
     message_system._append_message("items_messages", "test")
     self.assertEqual(self.request.session.get("items_messages"), ["test"])