Ejemplo n.º 1
0
 def _messageWithPostiniHeader(self, header):
     part = Part()
     part.addHeader(u'X-pstn-levels', unicode(header))
     msg = Message(store=self.store)
     # part._addToStore(self.store, msg, None)
     part.associateWithMessage(msg)
     msg.impl = part
     return msg
Ejemplo n.º 2
0
 def _messageWithPostiniHeader(self, header):
     part = Part()
     part.addHeader(u"X-pstn-levels", unicode(header))
     msg = Message(store=self.store)
     # part._addToStore(self.store, msg, None)
     part.associateWithMessage(msg)
     msg.impl = part
     return msg
Ejemplo n.º 3
0
 def testPreferredFormat(self):
     """
     Make sure that we are sent the preferred type of text/html.
     """
     s = Store()
     m = Message(store=s)
     impl = PartItem(store=s)
     m.impl = impl
     installOn(PreferenceAggregator(store=s), s)
     mdp = MessageDisplayPreferenceCollection(store=s)
     installOn(mdp, s)
     m.walkMessage()
     self.assertEqual(impl.preferred, 'text/html')
Ejemplo n.º 4
0
 def testPreferredFormat(self):
     """
     Make sure that we are sent the preferred type of text/html.
     """
     s = Store()
     m = Message(store=s)
     impl = PartItem(store=s)
     m.impl = impl
     installOn(PreferenceAggregator(store=s), s)
     mdp = MessageDisplayPreferenceCollection(store=s)
     installOn(mdp, s)
     m.walkMessage()
     self.assertEqual(impl.preferred, 'text/html')