Mercurial > p > roundup > code
annotate test/test_mailgw.py @ 602:c242455d9b46 config-0-4-0-branch
Brought the config branch up to date with HEAD
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 06 Feb 2002 04:05:55 +0000 |
| parents | a1a44636bace |
| children |
| rev | line source |
|---|---|
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1 # |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2 # Copyright (c) 2001 Richard Jones, richard@bofh.asn.au. |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
3 # This module is free software, and you may redistribute it and/or modify |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
4 # under the same terms as Python, so long as this copyright message and |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
5 # disclaimer are retained in their original form. |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
6 # |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
7 # This module is distributed in the hope that it will be useful, |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
10 # |
|
602
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
11 # $Id: test_mailgw.py,v 1.1.2.1 2002-02-06 04:05:55 richard Exp $ |
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
12 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
13 import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
14 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
15 from roundup.mailgw import MailGW |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
16 from roundup import init, instance |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
17 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
18 class MailgwTestCase(unittest.TestCase): |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
19 count = 0 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
20 schema = 'classic' |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
21 def setUp(self): |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
22 MailgwTestCase.count = MailgwTestCase.count + 1 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
23 self.dirname = '_test_%s'%self.count |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
24 try: |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
25 shutil.rmtree(self.dirname) |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
26 except OSError, error: |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
27 if error.errno not in (errno.ENOENT, errno.ESRCH): raise |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
28 # create the instance |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
29 init.init(self.dirname, self.schema, 'anydbm', 'sekrit') |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
30 # check we can load the package |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
31 self.instance = instance.open(self.dirname) |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
32 # and open the database |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
33 self.db = self.instance.open('sekrit') |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
34 self.db.user.create(username='Chef', address='chef@bork.bork.bork') |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
35 self.db.user.create(username='richard', address='richard@test') |
|
602
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
36 self.db.user.create(username='mary', address='mary@test') |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
37 self.db.user.create(username='john', address='john@test') |
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
38 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
39 def tearDown(self): |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
40 if os.path.exists(os.environ['SENDMAILDEBUG']): |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
41 os.remove(os.environ['SENDMAILDEBUG']) |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
42 try: |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
43 shutil.rmtree(self.dirname) |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
44 except OSError, error: |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
45 if error.errno not in (errno.ENOENT, errno.ESRCH): raise |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
46 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
47 def testNewIssue(self): |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
48 message = cStringIO.StringIO('''Content-Type: text/plain; |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
49 charset="iso-8859-1" |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
50 From: Chef <chef@bork.bork.bork |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
51 To: issue_tracker@fill.me.in. |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
52 Cc: richard@test |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
53 Message-Id: <dummy_test_message_id> |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
54 Subject: [issue] Testing... |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
55 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
56 This is a test submission of a new issue. |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
57 ''') |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
58 handler = self.instance.MailGW(self.instance, self.db) |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
59 handler.main(message) |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
60 if os.path.exists(os.environ['SENDMAILDEBUG']): |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
61 error = open(os.environ['SENDMAILDEBUG']).read() |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
62 self.assertEqual('no error', error) |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
63 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
64 def testNewIssueAuthMsg(self): |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
65 message = cStringIO.StringIO('''Content-Type: text/plain; |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
66 charset="iso-8859-1" |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
67 From: Chef <chef@bork.bork.bork |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
68 To: issue_tracker@fill.me.in. |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
69 Message-Id: <dummy_test_message_id> |
|
602
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
70 Subject: [issue] Testing... [nosy=mary; assignedto=richard] |
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
71 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
72 This is a test submission of a new issue. |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
73 ''') |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
74 handler = self.instance.MailGW(self.instance, self.db) |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
75 # TODO: fix the damn config - this is apalling |
|
602
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
76 self.db.config.MESSAGES_TO_AUTHOR = 'yes' |
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
77 handler.main(message) |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
78 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
79 self.assertEqual(open(os.environ['SENDMAILDEBUG']).read(), |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
80 '''FROM: roundup-admin@fill.me.in. |
|
602
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
81 TO: chef@bork.bork.bork, mary@test, richard@test |
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
82 Content-Type: text/plain |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
83 Subject: [issue1] Testing... |
|
602
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
84 To: chef@bork.bork.bork, mary@test, richard@test |
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
85 From: Chef <issue_tracker@fill.me.in.> |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
86 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.> |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
87 MIME-Version: 1.0 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
88 Message-Id: <dummy_test_message_id> |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
89 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
90 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
91 New submission from Chef <chef@bork.bork.bork>: |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
92 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
93 This is a test submission of a new issue. |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
94 |
|
602
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
95 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
96 ---------- |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
97 assignedto: richard |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
98 messages: 1 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
99 nosy: mary, Chef, richard |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
100 status: unread |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
101 title: Testing... |
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
102 ___________________________________________________ |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
103 "Roundup issue tracker" <issue_tracker@fill.me.in.> |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
104 http://some.useful.url/issue1 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
105 ___________________________________________________ |
|
602
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
106 ''') |
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
107 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
108 def testFollowup(self): |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
109 self.testNewIssue() |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
110 message = cStringIO.StringIO('''Content-Type: text/plain; |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
111 charset="iso-8859-1" |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
112 From: richard <richard@test> |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
113 To: issue_tracker@fill.me.in. |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
114 Message-Id: <followup_dummy_id> |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
115 In-Reply-To: <dummy_test_message_id> |
|
602
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
116 Subject: [issue1] Testing... [assignedto=mary; nosy=john] |
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
117 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
118 This is a followup |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
119 ''') |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
120 handler = self.instance.MailGW(self.instance, self.db) |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
121 handler.main(message) |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
122 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
123 self.assertEqual(open(os.environ['SENDMAILDEBUG']).read(), |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
124 '''FROM: roundup-admin@fill.me.in. |
|
602
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
125 TO: chef@bork.bork.bork, mary@test, john@test |
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
126 Content-Type: text/plain |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
127 Subject: [issue1] Testing... |
|
602
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
128 To: chef@bork.bork.bork, mary@test, john@test |
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
129 From: richard <issue_tracker@fill.me.in.> |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
130 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.> |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
131 MIME-Version: 1.0 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
132 Message-Id: <followup_dummy_id> |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
133 In-Reply-To: <dummy_test_message_id> |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
134 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
135 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
136 richard <richard@test> added the comment: |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
137 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
138 This is a followup |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
139 |
|
602
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
140 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
141 ---------- |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
142 assignedto: -> mary |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
143 nosy: +mary, john |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
144 status: unread -> chatting |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
145 ___________________________________________________ |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
146 "Roundup issue tracker" <issue_tracker@fill.me.in.> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
147 http://some.useful.url/issue1 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
148 ___________________________________________________ |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
149 ''', 'Generated message not correct') |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
150 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
151 def testFollowup2(self): |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
152 self.testNewIssue() |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
153 message = cStringIO.StringIO('''Content-Type: text/plain; |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
154 charset="iso-8859-1" |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
155 From: mary <mary@test> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
156 To: issue_tracker@fill.me.in. |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
157 Message-Id: <followup_dummy_id> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
158 In-Reply-To: <dummy_test_message_id> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
159 Subject: [issue1] Testing... |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
160 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
161 This is a second followup |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
162 ''') |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
163 handler = self.instance.MailGW(self.instance, self.db) |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
164 handler.main(message) |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
165 self.assertEqual(open(os.environ['SENDMAILDEBUG']).read(), |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
166 '''FROM: roundup-admin@fill.me.in. |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
167 TO: chef@bork.bork.bork, richard@test |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
168 Content-Type: text/plain |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
169 Subject: [issue1] Testing... |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
170 To: chef@bork.bork.bork, richard@test |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
171 From: mary <issue_tracker@fill.me.in.> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
172 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
173 MIME-Version: 1.0 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
174 Message-Id: <followup_dummy_id> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
175 In-Reply-To: <dummy_test_message_id> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
176 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
177 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
178 mary <mary@test> added the comment: |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
179 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
180 This is a second followup |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
181 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
182 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
183 ---------- |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
184 status: unread -> chatting |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
185 ___________________________________________________ |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
186 "Roundup issue tracker" <issue_tracker@fill.me.in.> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
187 http://some.useful.url/issue1 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
188 ___________________________________________________ |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
189 ''', 'Generated message not correct') |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
190 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
191 def testEnc01(self): |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
192 self.testNewIssue() |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
193 message = cStringIO.StringIO('''Content-Type: text/plain; |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
194 charset="iso-8859-1" |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
195 From: mary <mary@test> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
196 To: issue_tracker@fill.me.in. |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
197 Message-Id: <followup_dummy_id> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
198 In-Reply-To: <dummy_test_message_id> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
199 Subject: [issue1] Testing... |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
200 Content-Type: text/plain; |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
201 charset="iso-8859-1" |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
202 Content-Transfer-Encoding: quoted-printable |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
203 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
204 A message with encoding (encoded oe =F6) |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
205 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
206 ''') |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
207 handler = self.instance.MailGW(self.instance, self.db) |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
208 handler.main(message) |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
209 message_data = open(os.environ['SENDMAILDEBUG']).read() |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
210 self.assertEqual(message_data, |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
211 '''FROM: roundup-admin@fill.me.in. |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
212 TO: chef@bork.bork.bork, richard@test |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
213 Content-Type: text/plain |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
214 Subject: [issue1] Testing... |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
215 To: chef@bork.bork.bork, richard@test |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
216 From: mary <issue_tracker@fill.me.in.> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
217 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
218 MIME-Version: 1.0 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
219 Message-Id: <followup_dummy_id> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
220 In-Reply-To: <dummy_test_message_id> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
221 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
222 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
223 mary <mary@test> added the comment: |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
224 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
225 A message with encoding (encoded oe ö) |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
226 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
227 ---------- |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
228 status: unread -> chatting |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
229 ___________________________________________________ |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
230 "Roundup issue tracker" <issue_tracker@fill.me.in.> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
231 http://some.useful.url/issue1 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
232 ___________________________________________________ |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
233 ''', 'Generated message not correct') |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
234 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
235 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
236 def testMultipartEnc01(self): |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
237 self.testNewIssue() |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
238 message = cStringIO.StringIO('''Content-Type: text/plain; |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
239 charset="iso-8859-1" |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
240 From: mary <mary@test> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
241 To: issue_tracker@fill.me.in. |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
242 Message-Id: <followup_dummy_id> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
243 In-Reply-To: <dummy_test_message_id> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
244 Subject: [issue1] Testing... |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
245 Content-Type: multipart/mixed; |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
246 boundary="----_=_NextPart_000_01" |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
247 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
248 This message is in MIME format. Since your mail reader does not understand |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
249 this format, some or all of this message may not be legible. |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
250 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
251 ------_=_NextPart_000_01 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
252 Content-Type: text/plain; |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
253 charset="iso-8859-1" |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
254 Content-Transfer-Encoding: quoted-printable |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
255 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
256 A message with first part encoded (encoded oe =F6) |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
257 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
258 ''') |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
259 handler = self.instance.MailGW(self.instance, self.db) |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
260 handler.main(message) |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
261 message_data = open(os.environ['SENDMAILDEBUG']).read() |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
262 self.assertEqual(message_data, |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
263 '''FROM: roundup-admin@fill.me.in. |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
264 TO: chef@bork.bork.bork, richard@test |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
265 Content-Type: text/plain |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
266 Subject: [issue1] Testing... |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
267 To: chef@bork.bork.bork, richard@test |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
268 From: mary <issue_tracker@fill.me.in.> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
269 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
270 MIME-Version: 1.0 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
271 Message-Id: <followup_dummy_id> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
272 In-Reply-To: <dummy_test_message_id> |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
273 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
274 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
275 mary <mary@test> added the comment: |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
276 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
277 A message with first part encoded (encoded oe ö) |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
278 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
279 ---------- |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
280 status: unread -> chatting |
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
281 ___________________________________________________ |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
282 "Roundup issue tracker" <issue_tracker@fill.me.in.> |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
283 http://some.useful.url/issue1 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
284 ___________________________________________________ |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
285 ''', 'Generated message not correct') |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
286 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
287 class ExtMailgwTestCase(MailgwTestCase): |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
288 schema = 'extended' |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
289 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
290 def suite(): |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
291 l = [unittest.makeSuite(MailgwTestCase, 'test'), |
|
602
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
292 unittest.makeSuite(ExtMailgwTestCase, 'test') |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
293 ] |
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
294 return unittest.TestSuite(l) |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
295 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
296 |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
297 # |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
298 # $Log: not supported by cvs2svn $ |
|
602
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
299 # Revision 1.9 2002/02/05 14:15:29 grubert |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
300 # . respect encodings in non multipart messages. |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
301 # |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
302 # Revision 1.8 2002/02/04 09:40:21 grubert |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
303 # . add test for multipart messages with first part being encoded. |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
304 # |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
305 # Revision 1.7 2002/01/22 11:54:45 rochecompaan |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
306 # Fixed status change in mail gateway. |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
307 # |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
308 # Revision 1.6 2002/01/21 10:05:48 rochecompaan |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
309 # Feature: |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
310 # . the mail gateway now responds with an error message when invalid |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
311 # values for arguments are specified for link or multilink properties |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
312 # . modified unit test to check nosy and assignedto when specified as |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
313 # arguments |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
314 # |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
315 # Fixed: |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
316 # . fixed setting nosy as argument in subject line |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
317 # |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
318 # Revision 1.5 2002/01/15 00:12:40 richard |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
319 # #503340 ] creating issue with [asignedto=p.ohly] |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
320 # |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
321 # Revision 1.4 2002/01/14 07:12:15 richard |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
322 # removed file writing from tests... |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
323 # |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
324 # Revision 1.3 2002/01/14 02:20:15 richard |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
325 # . changed all config accesses so they access either the instance or the |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
326 # config attriubute on the db. This means that all config is obtained from |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
327 # instance_config instead of the mish-mash of classes. This will make |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
328 # switching to a ConfigParser setup easier too, I hope. |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
329 # |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
330 # At a minimum, this makes migration a _little_ easier (a lot easier in the |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
331 # 0.5.0 switch, I hope!) |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
332 # |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
333 # Revision 1.2 2002/01/11 23:22:29 richard |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
334 # . #502437 ] rogue reactor and unittest |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
335 # in short, the nosy reactor was modifying the nosy list. That code had |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
336 # been there for a long time, and I suspsect it was there because we |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
337 # weren't generating the nosy list correctly in other places of the code. |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
338 # We're now doing that, so the nosy-modifying code can go away from the |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
339 # nosy reactor. |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
340 # |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
341 # Revision 1.1 2002/01/02 02:31:38 richard |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
342 # Sorry for the huge checkin message - I was only intending to implement #496356 |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
343 # but I found a number of places where things had been broken by transactions: |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
344 # . modified ROUNDUPDBSENDMAILDEBUG to be SENDMAILDEBUG and hold a filename |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
345 # for _all_ roundup-generated smtp messages to be sent to. |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
346 # . the transaction cache had broken the roundupdb.Class set() reactors |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
347 # . newly-created author users in the mailgw weren't being committed to the db |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
348 # |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
349 # Stuff that made it into CHANGES.txt (ie. the stuff I was actually working |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
350 # on when I found that stuff :): |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
351 # . #496356 ] Use threading in messages |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
352 # . detectors were being registered multiple times |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
353 # . added tests for mailgw |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
354 # . much better attaching of erroneous messages in the mail gateway |
|
c242455d9b46
Brought the config branch up to date with HEAD
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
355 # |
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
356 # |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
357 # |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
358 # |
|
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
359 # vim: set filetype=python ts=4 sw=4 et si |
