예제 #1
0
 def testMailinMultipart(self):
     p = self.p
     self.p.subscribe(TESTSENDER)
     from email.MIMEText import MIMEText
     from email.MIMEMultipart import MIMEMultipart
     msg = MIMEMultipart()
     msg['From'] = TESTSENDER
     msg['To'] = TESTTO
     msg.attach(MIMEText('*bold*'))
     msg.attach(MIMEText('<b>bold</b>','html'))
     mailin.mailin(p, msg.as_string())
     self.assertEqual(1, p.commentCount())
     self.assertEqual(1, len(re.findall(r'\*bold\*', p.text())))
예제 #2
0
 def testMailinTrackerIssueLongSubject(self):
     longsubjmsg = str(TestMessage(to='bugs@somewhere',subject=LONGSUBJECT))
     self.p.upgradeFolderIssueProperties()
     self.assertEqual(0, self.p.issueCount())
     mailin.mailin(self.p.folder(),longsubjmsg)
     self.assertEqual(1, self.p.issueCount())
예제 #3
0
 def testMailinTrackerIssue(self):
     self.p.upgradeFolderIssueProperties()
     self.assertEqual(0, self.p.issueCount())
     mailin.mailin(self.p.folder(),
                   str(TestMessage(to='bugs@somewhere')))
     self.assertEqual(1, self.p.issueCount())
예제 #4
0
 def testNonSubscriberMailinWithOpenPosting(self):
     old = self.p.text()
     mailin.mailin(self.p,TESTMSG)
     self.assertEqual(1, len(re.findall(TESTBODY,self.p.text())))
예제 #5
0
 def testNonSubscriberMailinFails(self):
     delattr(self.p.folder(),'mailin_policy')
     old = self.p.text()
     mailin.mailin(self.p,TESTMSG)
     self.assertEqual(old, self.p.read())
예제 #6
0
 def testSubscriberMailin(self):
     delattr(self.p.folder(),'mailin_policy')
     old = self.p.text()
     self.p.subscribe(TESTSENDER)
     mailin.mailin(self.p,TESTMSG)
     self.assertEqual(1, len(re.findall(TESTBODY,self.p.text())))