Code

'I must run unit tests before committing\n' * 100
[roundup.git] / test / test_mailgw.py
1 #
2 # Copyright (c) 2001 Richard Jones, richard@bofh.asn.au.
3 # This module is free software, and you may redistribute it and/or modify
4 # under the same terms as Python, so long as this copyright message and
5 # disclaimer are retained in their original form.
6 #
7 # This module is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 #
11 # $Id: test_mailgw.py,v 1.19 2002-05-23 04:26:05 richard Exp $
13 import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib
15 from roundup.mailgw import MailGW
16 from roundup import init, instance
18 # TODO: make this output only enough equal lines for context, not all of
19 # them
20 class DiffHelper:
21     def compareStrings(self, s2, s1):
22         '''Note the reversal of s2 and s1 - difflib.SequenceMatcher wants
23            the first to be the "original" but in the calls in this file,
24            the second arg is the original. Ho hum.
25         '''
26         if s1 == s2:
27             return
29         # under python2.[12] we allow a difference of one trailing empty line.
30         if sys.version_info[0:2] == (2,1):
31             if s1+'\n' == s2:
32                 return
33         if sys.version_info[0:2] == (2,2):
34             if s1 == s2+'\n':
35                 return
36         
37         l1=s1.split('\n')
38         l2=s2.split('\n')
39         s = difflib.SequenceMatcher(None, l1, l2)
40         res = ['Generated message not correct (diff follows):']
41         for value, s1s, s1e, s2s, s2e in s.get_opcodes():
42             if value == 'equal':
43                 for i in range(s1s, s1e):
44                     res.append('  %s'%l1[i])
45             elif value == 'delete':
46                 for i in range(s1s, s1e):
47                     res.append('- %s'%l1[i])
48             elif value == 'insert':
49                 for i in range(s2s, s2e):
50                     res.append('+ %s'%l2[i])
51             elif value == 'replace':
52                 for i, j in zip(range(s1s, s1e), range(s2s, s2e)):
53                     res.append('- %s'%l1[i])
54                     res.append('+ %s'%l2[j])
56         raise AssertionError, '\n'.join(res)
58 class MailgwTestCase(unittest.TestCase, DiffHelper):
59     count = 0
60     schema = 'classic'
61     def setUp(self):
62         MailgwTestCase.count = MailgwTestCase.count + 1
63         self.dirname = '_test_mailgw_%s'%self.count
64         try:
65             shutil.rmtree(self.dirname)
66         except OSError, error:
67             if error.errno not in (errno.ENOENT, errno.ESRCH): raise
68         # create the instance
69         init.install(self.dirname, 'classic', 'anydbm')
70         init.initialise(self.dirname, 'sekrit')
71         # check we can load the package
72         self.instance = instance.open(self.dirname)
73         # and open the database
74         self.db = self.instance.open('sekrit')
75         self.db.user.create(username='Chef', address='chef@bork.bork.bork')
76         self.db.user.create(username='richard', address='richard@test')
77         self.db.user.create(username='mary', address='mary@test')
78         self.db.user.create(username='john', address='john@test',
79             alternate_addresses='jondoe@test\njohn.doe@test')
81     def tearDown(self):
82         if os.path.exists(os.environ['SENDMAILDEBUG']):
83             os.remove(os.environ['SENDMAILDEBUG'])
84         try:
85             shutil.rmtree(self.dirname)
86         except OSError, error:
87             if error.errno not in (errno.ENOENT, errno.ESRCH): raise
89     def testNewIssue(self):
90         message = cStringIO.StringIO('''Content-Type: text/plain;
91   charset="iso-8859-1"
92 From: Chef <chef@bork.bork.bork
93 To: issue_tracker@your.tracker.email.domain.example
94 Cc: richard@test
95 Message-Id: <dummy_test_message_id>
96 Subject: [issue] Testing...
98 This is a test submission of a new issue.
99 ''')
100         handler = self.instance.MailGW(self.instance, self.db)
101         nodeid = handler.main(message)
102         if os.path.exists(os.environ['SENDMAILDEBUG']):
103             error = open(os.environ['SENDMAILDEBUG']).read()
104             self.assertEqual('no error', error)
105         l = self.db.issue.get(nodeid, 'nosy')
106         l.sort()
107         self.assertEqual(l, ['2', '3'])
109     def testNewIssueNosy(self):
110         self.instance.ADD_AUTHOR_TO_NOSY = 'yes'
111         message = cStringIO.StringIO('''Content-Type: text/plain;
112   charset="iso-8859-1"
113 From: Chef <chef@bork.bork.bork
114 To: issue_tracker@your.tracker.email.domain.example
115 Cc: richard@test
116 Message-Id: <dummy_test_message_id>
117 Subject: [issue] Testing...
119 This is a test submission of a new issue.
120 ''')
121         handler = self.instance.MailGW(self.instance, self.db)
122         nodeid = handler.main(message)
123         if os.path.exists(os.environ['SENDMAILDEBUG']):
124             error = open(os.environ['SENDMAILDEBUG']).read()
125             self.assertEqual('no error', error)
126         l = self.db.issue.get(nodeid, 'nosy')
127         l.sort()
128         self.assertEqual(l, ['2', '3'])
130     def testAlternateAddress(self):
131         message = cStringIO.StringIO('''Content-Type: text/plain;
132   charset="iso-8859-1"
133 From: John Doe <john.doe@test>
134 To: issue_tracker@your.tracker.email.domain.example
135 Message-Id: <dummy_test_message_id>
136 Subject: [issue] Testing...
138 This is a test submission of a new issue.
139 ''')
140         userlist = self.db.user.list()
141         handler = self.instance.MailGW(self.instance, self.db)
142         handler.main(message)
143         if os.path.exists(os.environ['SENDMAILDEBUG']):
144             error = open(os.environ['SENDMAILDEBUG']).read()
145             self.assertEqual('no error', error)
146         self.assertEqual(userlist, self.db.user.list(),
147             "user created when it shouldn't have been")
149     def testNewIssueNoClass(self):
150         message = cStringIO.StringIO('''Content-Type: text/plain;
151   charset="iso-8859-1"
152 From: Chef <chef@bork.bork.bork
153 To: issue_tracker@your.tracker.email.domain.example
154 Cc: richard@test
155 Message-Id: <dummy_test_message_id>
156 Subject: Testing...
158 This is a test submission of a new issue.
159 ''')
160         handler = self.instance.MailGW(self.instance, self.db)
161         handler.main(message)
162         if os.path.exists(os.environ['SENDMAILDEBUG']):
163             error = open(os.environ['SENDMAILDEBUG']).read()
164             self.assertEqual('no error', error)
166     def testNewIssueAuthMsg(self):
167         message = cStringIO.StringIO('''Content-Type: text/plain;
168   charset="iso-8859-1"
169 From: Chef <chef@bork.bork.bork
170 To: issue_tracker@your.tracker.email.domain.example
171 Message-Id: <dummy_test_message_id>
172 Subject: [issue] Testing... [nosy=mary; assignedto=richard]
174 This is a test submission of a new issue.
175 ''')
176         handler = self.instance.MailGW(self.instance, self.db)
177         # TODO: fix the damn config - this is apalling
178         self.db.config.MESSAGES_TO_AUTHOR = 'yes'
179         handler.main(message)
181         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
182 '''FROM: roundup-admin@your.tracker.email.domain.example
183 TO: chef@bork.bork.bork, mary@test, richard@test
184 Content-Type: text/plain
185 Subject: [issue1] Testing...
186 To: chef@bork.bork.bork, mary@test, richard@test
187 From: Chef <issue_tracker@your.tracker.email.domain.example>
188 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
189 MIME-Version: 1.0
190 Message-Id: <dummy_test_message_id>
191 X-Roundup-Name: Roundup issue tracker
192 Content-Transfer-Encoding: quoted-printable
195 New submission from Chef <chef@bork.bork.bork>:
197 This is a test submission of a new issue.
200 ----------
201 assignedto: richard
202 messages: 1
203 nosy: Chef, mary, richard
204 status: unread
205 title: Testing...
206 _________________________________________________________________________
207 "Roundup issue tracker" <issue_tracker@your.tracker.email.domain.example>
208 http://your.tracker.url.example/issue1
209 _________________________________________________________________________
210 ''')
212     # BUG
213     # def testMultipart(self):
214     #         '''With more than one part'''
215     #        see MultipartEnc tests: but if there is more than one part
216     #        we return a multipart/mixed and the boundary contains
217     #        the ip address of the test machine. 
219     # BUG should test some binary attamchent too.
221     def testFollowup(self):
222         self.testNewIssue()
223         message = cStringIO.StringIO('''Content-Type: text/plain;
224   charset="iso-8859-1"
225 From: richard <richard@test>
226 To: issue_tracker@your.tracker.email.domain.example
227 Message-Id: <followup_dummy_id>
228 In-Reply-To: <dummy_test_message_id>
229 Subject: [issue1] Testing... [assignedto=mary; nosy=john]
231 This is a followup
232 ''')
233         handler = self.instance.MailGW(self.instance, self.db)
234         handler.main(message)
236         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
237 '''FROM: roundup-admin@your.tracker.email.domain.example
238 TO: chef@bork.bork.bork, john@test, mary@test
239 Content-Type: text/plain
240 Subject: [issue1] Testing...
241 To: chef@bork.bork.bork, john@test, mary@test
242 From: richard <issue_tracker@your.tracker.email.domain.example>
243 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
244 MIME-Version: 1.0
245 Message-Id: <followup_dummy_id>
246 In-Reply-To: <dummy_test_message_id>
247 X-Roundup-Name: Roundup issue tracker
248 Content-Transfer-Encoding: quoted-printable
251 richard <richard@test> added the comment:
253 This is a followup
256 ----------
257 assignedto:  -> mary
258 nosy: +mary, john
259 status: unread -> chatting
260 _________________________________________________________________________
261 "Roundup issue tracker" <issue_tracker@your.tracker.email.domain.example>
262 http://your.tracker.url.example/issue1
263 _________________________________________________________________________
264 ''')
266     def testFollowup2(self):
267         self.testNewIssue()
268         message = cStringIO.StringIO('''Content-Type: text/plain;
269   charset="iso-8859-1"
270 From: mary <mary@test>
271 To: issue_tracker@your.tracker.email.domain.example
272 Message-Id: <followup_dummy_id>
273 In-Reply-To: <dummy_test_message_id>
274 Subject: [issue1] Testing...
276 This is a second followup
277 ''')
278         handler = self.instance.MailGW(self.instance, self.db)
279         handler.main(message)
280         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
281 '''FROM: roundup-admin@your.tracker.email.domain.example
282 TO: chef@bork.bork.bork, richard@test
283 Content-Type: text/plain
284 Subject: [issue1] Testing...
285 To: chef@bork.bork.bork, richard@test
286 From: mary <issue_tracker@your.tracker.email.domain.example>
287 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
288 MIME-Version: 1.0
289 Message-Id: <followup_dummy_id>
290 In-Reply-To: <dummy_test_message_id>
291 X-Roundup-Name: Roundup issue tracker
292 Content-Transfer-Encoding: quoted-printable
295 mary <mary@test> added the comment:
297 This is a second followup
300 ----------
301 status: unread -> chatting
302 _________________________________________________________________________
303 "Roundup issue tracker" <issue_tracker@your.tracker.email.domain.example>
304 http://your.tracker.url.example/issue1
305 _________________________________________________________________________
306 ''')
308     def testFollowupTitleMatch(self):
309         self.testNewIssue()
310         message = cStringIO.StringIO('''Content-Type: text/plain;
311   charset="iso-8859-1"
312 From: richard <richard@test>
313 To: issue_tracker@your.tracker.email.domain.example
314 Message-Id: <followup_dummy_id>
315 In-Reply-To: <dummy_test_message_id>
316 Subject: Re: Testing... [assignedto=mary; nosy=john]
318 This is a followup
319 ''')
320         handler = self.instance.MailGW(self.instance, self.db)
321         handler.main(message)
323         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
324 '''FROM: roundup-admin@your.tracker.email.domain.example
325 TO: chef@bork.bork.bork, john@test, mary@test
326 Content-Type: text/plain
327 Subject: [issue1] Testing...
328 To: chef@bork.bork.bork, john@test, mary@test
329 From: richard <issue_tracker@your.tracker.email.domain.example>
330 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
331 MIME-Version: 1.0
332 Message-Id: <followup_dummy_id>
333 In-Reply-To: <dummy_test_message_id>
334 X-Roundup-Name: Roundup issue tracker
335 Content-Transfer-Encoding: quoted-printable
338 richard <richard@test> added the comment:
340 This is a followup
343 ----------
344 assignedto:  -> mary
345 nosy: +mary, john
346 status: unread -> chatting
347 _________________________________________________________________________
348 "Roundup issue tracker" <issue_tracker@your.tracker.email.domain.example>
349 http://your.tracker.url.example/issue1
350 _________________________________________________________________________
351 ''')
353     def testFollowupNosyAuthor(self):
354         self.testNewIssue()
355         self.instance.ADD_AUTHOR_TO_NOSY = 'yes'
356         message = cStringIO.StringIO('''Content-Type: text/plain;
357   charset="iso-8859-1"
358 From: john@test
359 To: issue_tracker@your.tracker.email.domain.example
360 Message-Id: <followup_dummy_id>
361 In-Reply-To: <dummy_test_message_id>
362 Subject: [issue1] Testing...
364 This is a followup
365 ''')
366         handler = self.instance.MailGW(self.instance, self.db)
367         handler.main(message)
369         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
370 '''FROM: roundup-admin@your.tracker.email.domain.example
371 TO: chef@bork.bork.bork, richard@test
372 Content-Type: text/plain
373 Subject: [issue1] Testing...
374 To: chef@bork.bork.bork, richard@test
375 From: john <issue_tracker@your.tracker.email.domain.example>
376 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
377 MIME-Version: 1.0
378 Message-Id: <followup_dummy_id>
379 In-Reply-To: <dummy_test_message_id>
380 X-Roundup-Name: Roundup issue tracker
381 Content-Transfer-Encoding: quoted-printable
384 john <john@test> added the comment:
386 This is a followup
389 ----------
390 nosy: +john
391 status: unread -> chatting
392 _________________________________________________________________________
393 "Roundup issue tracker" <issue_tracker@your.tracker.email.domain.example>
394 http://your.tracker.url.example/issue1
395 _________________________________________________________________________
397 ''')
399     def testFollowupNosyRecipients(self):
400         self.testNewIssue()
401         self.instance.ADD_RECIPIENTS_TO_NOSY = 'yes'
402         message = cStringIO.StringIO('''Content-Type: text/plain;
403   charset="iso-8859-1"
404 From: richard@test
405 To: issue_tracker@your.tracker.email.domain.example
406 Cc: john@test
407 Message-Id: <followup_dummy_id>
408 In-Reply-To: <dummy_test_message_id>
409 Subject: [issue1] Testing...
411 This is a followup
412 ''')
413         handler = self.instance.MailGW(self.instance, self.db)
414         handler.main(message)
416         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
417 '''FROM: roundup-admin@your.tracker.email.domain.example
418 TO: chef@bork.bork.bork
419 Content-Type: text/plain
420 Subject: [issue1] Testing...
421 To: chef@bork.bork.bork
422 From: richard <issue_tracker@your.tracker.email.domain.example>
423 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
424 MIME-Version: 1.0
425 Message-Id: <followup_dummy_id>
426 In-Reply-To: <dummy_test_message_id>
427 X-Roundup-Name: Roundup issue tracker
428 Content-Transfer-Encoding: quoted-printable
431 richard <richard@test> added the comment:
433 This is a followup
436 ----------
437 nosy: +john
438 status: unread -> chatting
439 _________________________________________________________________________
440 "Roundup issue tracker" <issue_tracker@your.tracker.email.domain.example>
441 http://your.tracker.url.example/issue1
442 _________________________________________________________________________
444 ''')
446     def testFollowupNosyAuthorAndCopy(self):
447         self.testNewIssue()
448         self.instance.ADD_AUTHOR_TO_NOSY = 'yes'
449         self.db.config.MESSAGES_TO_AUTHOR = 'yes'
450         message = cStringIO.StringIO('''Content-Type: text/plain;
451   charset="iso-8859-1"
452 From: john@test
453 To: issue_tracker@your.tracker.email.domain.example
454 Message-Id: <followup_dummy_id>
455 In-Reply-To: <dummy_test_message_id>
456 Subject: [issue1] Testing...
458 This is a followup
459 ''')
460         handler = self.instance.MailGW(self.instance, self.db)
461         handler.main(message)
463         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
464 '''FROM: roundup-admin@your.tracker.email.domain.example
465 TO: chef@bork.bork.bork, john@test, richard@test
466 Content-Type: text/plain
467 Subject: [issue1] Testing...
468 To: chef@bork.bork.bork, john@test, richard@test
469 From: john <issue_tracker@your.tracker.email.domain.example>
470 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
471 MIME-Version: 1.0
472 Message-Id: <followup_dummy_id>
473 In-Reply-To: <dummy_test_message_id>
474 X-Roundup-Name: Roundup issue tracker
475 Content-Transfer-Encoding: quoted-printable
478 john <john@test> added the comment:
480 This is a followup
483 ----------
484 nosy: +john
485 status: unread -> chatting
486 _________________________________________________________________________
487 "Roundup issue tracker" <issue_tracker@your.tracker.email.domain.example>
488 http://your.tracker.url.example/issue1
489 _________________________________________________________________________
491 ''')
493     def testFollowupNoNosyAuthor(self):
494         self.testNewIssue()
495         self.instance.ADD_AUTHOR_TO_NOSY = 'no'
496         message = cStringIO.StringIO('''Content-Type: text/plain;
497   charset="iso-8859-1"
498 From: john@test
499 To: issue_tracker@your.tracker.email.domain.example
500 Message-Id: <followup_dummy_id>
501 In-Reply-To: <dummy_test_message_id>
502 Subject: [issue1] Testing...
504 This is a followup
505 ''')
506         handler = self.instance.MailGW(self.instance, self.db)
507         handler.main(message)
509         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
510 '''FROM: roundup-admin@your.tracker.email.domain.example
511 TO: chef@bork.bork.bork, richard@test
512 Content-Type: text/plain
513 Subject: [issue1] Testing...
514 To: chef@bork.bork.bork, richard@test
515 From: john <issue_tracker@your.tracker.email.domain.example>
516 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
517 MIME-Version: 1.0
518 Message-Id: <followup_dummy_id>
519 In-Reply-To: <dummy_test_message_id>
520 X-Roundup-Name: Roundup issue tracker
521 Content-Transfer-Encoding: quoted-printable
524 john <john@test> added the comment:
526 This is a followup
529 ----------
530 status: unread -> chatting
531 _________________________________________________________________________
532 "Roundup issue tracker" <issue_tracker@your.tracker.email.domain.example>
533 http://your.tracker.url.example/issue1
534 _________________________________________________________________________
536 ''')
538     def testFollowupNoNosyRecipients(self):
539         self.testNewIssue()
540         self.instance.ADD_RECIPIENTS_TO_NOSY = 'no'
541         message = cStringIO.StringIO('''Content-Type: text/plain;
542   charset="iso-8859-1"
543 From: richard@test
544 To: issue_tracker@your.tracker.email.domain.example
545 Cc: john@test
546 Message-Id: <followup_dummy_id>
547 In-Reply-To: <dummy_test_message_id>
548 Subject: [issue1] Testing...
550 This is a followup
551 ''')
552         handler = self.instance.MailGW(self.instance, self.db)
553         handler.main(message)
555         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
556 '''FROM: roundup-admin@your.tracker.email.domain.example
557 TO: chef@bork.bork.bork
558 Content-Type: text/plain
559 Subject: [issue1] Testing...
560 To: chef@bork.bork.bork
561 From: richard <issue_tracker@your.tracker.email.domain.example>
562 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
563 MIME-Version: 1.0
564 Message-Id: <followup_dummy_id>
565 In-Reply-To: <dummy_test_message_id>
566 X-Roundup-Name: Roundup issue tracker
567 Content-Transfer-Encoding: quoted-printable
570 richard <richard@test> added the comment:
572 This is a followup
575 ----------
576 status: unread -> chatting
577 _________________________________________________________________________
578 "Roundup issue tracker" <issue_tracker@your.tracker.email.domain.example>
579 http://your.tracker.url.example/issue1
580 _________________________________________________________________________
582 ''')
584     def testEnc01(self):
585         self.testNewIssue()
586         message = cStringIO.StringIO('''Content-Type: text/plain;
587   charset="iso-8859-1"
588 From: mary <mary@test>
589 To: issue_tracker@your.tracker.email.domain.example
590 Message-Id: <followup_dummy_id>
591 In-Reply-To: <dummy_test_message_id>
592 Subject: [issue1] Testing...
593 Content-Type: text/plain;
594         charset="iso-8859-1"
595 Content-Transfer-Encoding: quoted-printable
597 A message with encoding (encoded oe =F6)
599 ''')
600         handler = self.instance.MailGW(self.instance, self.db)
601         handler.main(message)
602         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
603 '''FROM: roundup-admin@your.tracker.email.domain.example
604 TO: chef@bork.bork.bork, richard@test
605 Content-Type: text/plain
606 Subject: [issue1] Testing...
607 To: chef@bork.bork.bork, richard@test
608 From: mary <issue_tracker@your.tracker.email.domain.example>
609 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
610 MIME-Version: 1.0
611 Message-Id: <followup_dummy_id>
612 In-Reply-To: <dummy_test_message_id>
613 X-Roundup-Name: Roundup issue tracker
614 Content-Transfer-Encoding: quoted-printable
617 mary <mary@test> added the comment:
619 A message with encoding (encoded oe =F6)
621 ----------
622 status: unread -> chatting
623 _________________________________________________________________________
624 "Roundup issue tracker" <issue_tracker@your.tracker.email.domain.example>
625 http://your.tracker.url.example/issue1
626 _________________________________________________________________________
627 ''')
630     def testMultipartEnc01(self):
631         self.testNewIssue()
632         message = cStringIO.StringIO('''Content-Type: text/plain;
633   charset="iso-8859-1"
634 From: mary <mary@test>
635 To: issue_tracker@your.tracker.email.domain.example
636 Message-Id: <followup_dummy_id>
637 In-Reply-To: <dummy_test_message_id>
638 Subject: [issue1] Testing...
639 Content-Type: multipart/mixed;
640         boundary="----_=_NextPart_000_01"
642 This message is in MIME format. Since your mail reader does not understand
643 this format, some or all of this message may not be legible.
645 ------_=_NextPart_000_01
646 Content-Type: text/plain;
647         charset="iso-8859-1"
648 Content-Transfer-Encoding: quoted-printable
650 A message with first part encoded (encoded oe =F6)
652 ''')
653         handler = self.instance.MailGW(self.instance, self.db)
654         handler.main(message)
655         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
656 '''FROM: roundup-admin@your.tracker.email.domain.example
657 TO: chef@bork.bork.bork, richard@test
658 Content-Type: text/plain
659 Subject: [issue1] Testing...
660 To: chef@bork.bork.bork, richard@test
661 From: mary <issue_tracker@your.tracker.email.domain.example>
662 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
663 MIME-Version: 1.0
664 Message-Id: <followup_dummy_id>
665 In-Reply-To: <dummy_test_message_id>
666 X-Roundup-Name: Roundup issue tracker
667 Content-Transfer-Encoding: quoted-printable
670 mary <mary@test> added the comment:
672 A message with first part encoded (encoded oe =F6)
674 ----------
675 status: unread -> chatting
676 _________________________________________________________________________
677 "Roundup issue tracker" <issue_tracker@your.tracker.email.domain.example>
678 http://your.tracker.url.example/issue1
679 _________________________________________________________________________
680 ''')
682 class ExtMailgwTestCase(MailgwTestCase):
683     schema = 'extended'
685 def suite():
686     l = [unittest.makeSuite(MailgwTestCase),
687          unittest.makeSuite(ExtMailgwTestCase, 'test')
688     ]
689     return unittest.TestSuite(l)
693 # $Log: not supported by cvs2svn $
694 # Revision 1.18  2002/05/15 03:27:16  richard
695 #  . fixed SCRIPT_NAME in ZRoundup for instances not at top level of Zope
696 #    (thanks dman)
697 #  . fixed some sorting issues that were breaking some unit tests under py2.2
698 #  . mailgw test output dir was confusing the init test (but only on 2.2 *shrug*)
700 # fixed bug in the init unit test that meant only the bsddb test ran if it
701 # could (it clobbered the anydbm test)
703 # Revision 1.17  2002/05/02 07:56:34  richard
704 # . added option to automatically add the authors and recipients of messages
705 #   to the nosy lists with the options ADD_AUTHOR_TO_NOSY (default 'new') and
706 #   ADD_RECIPIENTS_TO_NOSY (default 'new'). These settings emulate the current
707 #   behaviour. Setting them to 'yes' will add the author/recipients to the nosy
708 #   on messages that create issues and followup messages.
709 # . added missing documentation for a few of the config option values
711 # Revision 1.16  2002/03/19 21:58:11  grubert
712 #  . for python2.1 test_mailgw compareString allows an extra trailing empty line (for quopri.
714 # Revision 1.15  2002/03/19 06:37:00  richard
715 # Made the email checking spit out a diff - much easier to spot the problem!
717 # Revision 1.14  2002/03/18 18:32:00  rochecompaan
718 # All messages sent to the nosy list are now encoded as quoted-printable.
720 # Revision 1.13  2002/02/15 07:08:45  richard
721 #  . Alternate email addresses are now available for users. See the MIGRATION
722 #    file for info on how to activate the feature.
724 # Revision 1.12  2002/02/15 00:13:38  richard
725 #  . #503204 ] mailgw needs a default class
726 #     - partially done - the setting of additional properties can wait for a
727 #       better configuration system.
729 # Revision 1.11  2002/02/14 23:38:12  richard
730 # Fixed the unit tests for the mailgw re: the x-roundup-name header.
731 # Also made the test runner more user-friendly:
732 #   ./run_tests            - detect all tests in test/test_<name>.py and run them
733 #   ./run_tests <name>     - run only test/test_<name>.py
734 # eg ./run_tests mailgw    - run the mailgw test from test/test_mailgw.py
736 # Revision 1.10  2002/02/12 08:08:55  grubert
737 #  . Clean up mail handling, multipart handling.
739 # Revision 1.9  2002/02/05 14:15:29  grubert
740 #  . respect encodings in non multipart messages.
742 # Revision 1.8  2002/02/04 09:40:21  grubert
743 #  . add test for multipart messages with first part being encoded.
745 # Revision 1.7  2002/01/22 11:54:45  rochecompaan
746 # Fixed status change in mail gateway.
748 # Revision 1.6  2002/01/21 10:05:48  rochecompaan
749 # Feature:
750 #  . the mail gateway now responds with an error message when invalid
751 #    values for arguments are specified for link or multilink properties
752 #  . modified unit test to check nosy and assignedto when specified as
753 #    arguments
755 # Fixed:
756 #  . fixed setting nosy as argument in subject line
758 # Revision 1.5  2002/01/15 00:12:40  richard
759 # #503340 ] creating issue with [asignedto=p.ohly]
761 # Revision 1.4  2002/01/14 07:12:15  richard
762 # removed file writing from tests...
764 # Revision 1.3  2002/01/14 02:20:15  richard
765 #  . changed all config accesses so they access either the instance or the
766 #    config attriubute on the db. This means that all config is obtained from
767 #    instance_config instead of the mish-mash of classes. This will make
768 #    switching to a ConfigParser setup easier too, I hope.
770 # At a minimum, this makes migration a _little_ easier (a lot easier in the
771 # 0.5.0 switch, I hope!)
773 # Revision 1.2  2002/01/11 23:22:29  richard
774 #  . #502437 ] rogue reactor and unittest
775 #    in short, the nosy reactor was modifying the nosy list. That code had
776 #    been there for a long time, and I suspsect it was there because we
777 #    weren't generating the nosy list correctly in other places of the code.
778 #    We're now doing that, so the nosy-modifying code can go away from the
779 #    nosy reactor.
781 # Revision 1.1  2002/01/02 02:31:38  richard
782 # Sorry for the huge checkin message - I was only intending to implement #496356
783 # but I found a number of places where things had been broken by transactions:
784 #  . modified ROUNDUPDBSENDMAILDEBUG to be SENDMAILDEBUG and hold a filename
785 #    for _all_ roundup-generated smtp messages to be sent to.
786 #  . the transaction cache had broken the roundupdb.Class set() reactors
787 #  . newly-created author users in the mailgw weren't being committed to the db
789 # Stuff that made it into CHANGES.txt (ie. the stuff I was actually working
790 # on when I found that stuff :):
791 #  . #496356 ] Use threading in messages
792 #  . detectors were being registered multiple times
793 #  . added tests for mailgw
794 #  . much better attaching of erroneous messages in the mail gateway
799 # vim: set filetype=python ts=4 sw=4 et si