예제 #1
0
 def test_update_list(self):
     """List records must be updated when changed in Mailman"""
     msg = Message()
     msg["From"] = "*****@*****.**"
     msg["Message-ID"] = "<dummy>"
     msg.set_payload("Dummy message")
     ml = FakeList("example-list")
     ml.display_name = u"name 1"
     self.store.add_to_list(ml, msg)
     ml_db = self.store.db.find(List).one()
     self.assertEqual(ml_db.display_name, "name 1")
     ml.display_name = u"name 2"
     self.store.add_to_list(ml, msg)
     ml_db = self.store.db.find(List).one()
     self.assertEqual(ml_db.display_name, "name 2")
예제 #2
0
 def test_update_list(self):
     """List records must be updated when changed in Mailman"""
     msg = Message()
     msg["From"] = "*****@*****.**"
     msg["Message-ID"] = "<dummy>"
     msg.set_payload("Dummy message")
     ml = FakeList("example-list")
     ml.display_name = u"name 1"
     ml.subject_prefix = u"[prefix 1]"
     self.store.add_to_list(ml, msg)
     ml_db = self.store.db.find(List).one()
     self.assertEqual(ml_db.display_name, "name 1")
     self.assertEqual(ml_db.subject_prefix, "[prefix 1]")
     ml.display_name = u"name 2"
     ml.subject_prefix = u"[prefix 2]"
     self.store.add_to_list(ml, msg)
     ml_db = self.store.db.find(List).one()
     self.assertEqual(ml_db.display_name, "name 2")
     self.assertEqual(ml_db.subject_prefix, "[prefix 2]")
예제 #3
0
    def add_fetch_data(self):
        msg = Message()
        msg["From"] = "*****@*****.**"
        msg["Subject"] = "Fake Subject"
        msg["Message-ID"] = "<dummy>"
        msg["Date"] = "Fri, 02 Nov 2012 16:07:54"
        msg.set_payload("Fake Message")

        ml = FakeList("example-list")
        ml.display_name = u"name 1"
        ml.subject_prefix = u"[prefix 1]"

        return ml.fqdn_listname, self.store.add_to_list(ml, msg)
예제 #4
0
    def add_fetch_data(self):
        msg = Message()
        msg["From"] = "*****@*****.**"
        msg["Subject"] = "Fake Subject"
        msg["Message-ID"] = "<dummy>"
        msg["Date"] = "Fri, 02 Nov 2012 16:07:54"
        msg.set_payload("Fake Message")

        ml = FakeList("example-list")
        ml.display_name = u"name 1"
        ml.subject_prefix = u"[prefix 1]"

        return ml.fqdn_listname, self.store.add_to_list(ml, msg)