Mercurial > p > roundup > code
comparison test/test_mailgw.py @ 3902:21420ba64b0d
fuller email validition (request [SF#216291])
Checks email syntax more rigorously.
Perform address checks against "address" and any "alternate_addresses".
Changed all of the unit tests to have addresses that pass this new check.
| author | Justus Pendleton <jpend@users.sourceforge.net> |
|---|---|
| date | Wed, 12 Sep 2007 21:11:14 +0000 |
| parents | f762fa13cd8d |
| children | 63ab356dfcf9 |
comparison
equal
deleted
inserted
replaced
| 3901:55e325e10a52 | 3902:21420ba64b0d |
|---|---|
| 6 # | 6 # |
| 7 # This module is distributed in the hope that it will be useful, | 7 # This module is distributed in the hope that it will be useful, |
| 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 10 # | 10 # |
| 11 # $Id: test_mailgw.py,v 1.88 2007-09-10 19:18:39 forsberg Exp $ | 11 # $Id: test_mailgw.py,v 1.89 2007-09-12 21:11:14 jpend Exp $ |
| 12 | 12 |
| 13 # TODO: test bcc | 13 # TODO: test bcc |
| 14 | 14 |
| 15 import unittest, tempfile, os, shutil, errno, imp, sys, difflib, rfc822, time | 15 import unittest, tempfile, os, shutil, errno, imp, sys, difflib, rfc822, time |
| 16 | 16 |
| 102 # and open the database | 102 # and open the database |
| 103 self.db = self.instance.open('admin') | 103 self.db = self.instance.open('admin') |
| 104 self.chef_id = self.db.user.create(username='Chef', | 104 self.chef_id = self.db.user.create(username='Chef', |
| 105 address='chef@bork.bork.bork', realname='Bork, Chef', roles='User') | 105 address='chef@bork.bork.bork', realname='Bork, Chef', roles='User') |
| 106 self.richard_id = self.db.user.create(username='richard', | 106 self.richard_id = self.db.user.create(username='richard', |
| 107 address='richard@test', roles='User') | 107 address='richard@test.test', roles='User') |
| 108 self.mary_id = self.db.user.create(username='mary', address='mary@test', | 108 self.mary_id = self.db.user.create(username='mary', address='mary@test.test', |
| 109 roles='User', realname='Contrary, Mary') | 109 roles='User', realname='Contrary, Mary') |
| 110 self.john_id = self.db.user.create(username='john', address='john@test', | 110 self.john_id = self.db.user.create(username='john', address='john@test.test', |
| 111 alternate_addresses='jondoe@test\njohn.doe@test', roles='User', | 111 alternate_addresses='jondoe@test.test\njohn.doe@test.test', roles='User', |
| 112 realname='John Doe') | 112 realname='John Doe') |
| 113 | 113 |
| 114 def tearDown(self): | 114 def tearDown(self): |
| 115 if os.path.exists(SENDMAILDEBUG): | 115 if os.path.exists(SENDMAILDEBUG): |
| 116 os.remove(SENDMAILDEBUG) | 116 os.remove(SENDMAILDEBUG) |
| 138 def testEmptyMessage(self): | 138 def testEmptyMessage(self): |
| 139 nodeid = self._handle_mail('''Content-Type: text/plain; | 139 nodeid = self._handle_mail('''Content-Type: text/plain; |
| 140 charset="iso-8859-1" | 140 charset="iso-8859-1" |
| 141 From: Chef <chef@bork.bork.bork> | 141 From: Chef <chef@bork.bork.bork> |
| 142 To: issue_tracker@your.tracker.email.domain.example | 142 To: issue_tracker@your.tracker.email.domain.example |
| 143 Cc: richard@test | 143 Cc: richard@test.test |
| 144 Reply-To: chef@bork.bork.bork | 144 Reply-To: chef@bork.bork.bork |
| 145 Message-Id: <dummy_test_message_id> | 145 Message-Id: <dummy_test_message_id> |
| 146 Subject: [issue] Testing... | 146 Subject: [issue] Testing... |
| 147 | 147 |
| 148 ''') | 148 ''') |
| 152 def doNewIssue(self): | 152 def doNewIssue(self): |
| 153 nodeid = self._handle_mail('''Content-Type: text/plain; | 153 nodeid = self._handle_mail('''Content-Type: text/plain; |
| 154 charset="iso-8859-1" | 154 charset="iso-8859-1" |
| 155 From: Chef <chef@bork.bork.bork> | 155 From: Chef <chef@bork.bork.bork> |
| 156 To: issue_tracker@your.tracker.email.domain.example | 156 To: issue_tracker@your.tracker.email.domain.example |
| 157 Cc: richard@test | 157 Cc: richard@test.test |
| 158 Message-Id: <dummy_test_message_id> | 158 Message-Id: <dummy_test_message_id> |
| 159 Subject: [issue] Testing... | 159 Subject: [issue] Testing... |
| 160 | 160 |
| 161 This is a test submission of a new issue. | 161 This is a test submission of a new issue. |
| 162 ''') | 162 ''') |
| 173 self.instance.config.ADD_AUTHOR_TO_NOSY = 'yes' | 173 self.instance.config.ADD_AUTHOR_TO_NOSY = 'yes' |
| 174 nodeid = self._handle_mail('''Content-Type: text/plain; | 174 nodeid = self._handle_mail('''Content-Type: text/plain; |
| 175 charset="iso-8859-1" | 175 charset="iso-8859-1" |
| 176 From: Chef <chef@bork.bork.bork> | 176 From: Chef <chef@bork.bork.bork> |
| 177 To: issue_tracker@your.tracker.email.domain.example | 177 To: issue_tracker@your.tracker.email.domain.example |
| 178 Cc: richard@test | 178 Cc: richard@test.test |
| 179 Message-Id: <dummy_test_message_id> | 179 Message-Id: <dummy_test_message_id> |
| 180 Subject: [issue] Testing... | 180 Subject: [issue] Testing... |
| 181 | 181 |
| 182 This is a test submission of a new issue. | 182 This is a test submission of a new issue. |
| 183 ''') | 183 ''') |
| 187 self.assertEqual(l, [self.chef_id, self.richard_id]) | 187 self.assertEqual(l, [self.chef_id, self.richard_id]) |
| 188 | 188 |
| 189 def testAlternateAddress(self): | 189 def testAlternateAddress(self): |
| 190 self._handle_mail('''Content-Type: text/plain; | 190 self._handle_mail('''Content-Type: text/plain; |
| 191 charset="iso-8859-1" | 191 charset="iso-8859-1" |
| 192 From: John Doe <john.doe@test> | 192 From: John Doe <john.doe@test.test> |
| 193 To: issue_tracker@your.tracker.email.domain.example | 193 To: issue_tracker@your.tracker.email.domain.example |
| 194 Message-Id: <dummy_test_message_id> | 194 Message-Id: <dummy_test_message_id> |
| 195 Subject: [issue] Testing... | 195 Subject: [issue] Testing... |
| 196 | 196 |
| 197 This is a test submission of a new issue. | 197 This is a test submission of a new issue. |
| 204 def testNewIssueNoClass(self): | 204 def testNewIssueNoClass(self): |
| 205 self._handle_mail('''Content-Type: text/plain; | 205 self._handle_mail('''Content-Type: text/plain; |
| 206 charset="iso-8859-1" | 206 charset="iso-8859-1" |
| 207 From: Chef <chef@bork.bork.bork> | 207 From: Chef <chef@bork.bork.bork> |
| 208 To: issue_tracker@your.tracker.email.domain.example | 208 To: issue_tracker@your.tracker.email.domain.example |
| 209 Cc: richard@test | 209 Cc: richard@test.test |
| 210 Message-Id: <dummy_test_message_id> | 210 Message-Id: <dummy_test_message_id> |
| 211 Subject: Testing... | 211 Subject: Testing... |
| 212 | 212 |
| 213 This is a test submission of a new issue. | 213 This is a test submission of a new issue. |
| 214 ''') | 214 ''') |
| 226 | 226 |
| 227 This is a test submission of a new issue. | 227 This is a test submission of a new issue. |
| 228 ''') | 228 ''') |
| 229 self.compareMessages(self._get_mail(), | 229 self.compareMessages(self._get_mail(), |
| 230 '''FROM: roundup-admin@your.tracker.email.domain.example | 230 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 231 TO: chef@bork.bork.bork, mary@test, richard@test | 231 TO: chef@bork.bork.bork, mary@test.test, richard@test.test |
| 232 Content-Type: text/plain; charset=utf-8 | 232 Content-Type: text/plain; charset=utf-8 |
| 233 Subject: [issue1] Testing... | 233 Subject: [issue1] Testing... |
| 234 To: chef@bork.bork.bork, mary@test, richard@test | 234 To: chef@bork.bork.bork, mary@test.test, richard@test.test |
| 235 From: "Bork, Chef" <issue_tracker@your.tracker.email.domain.example> | 235 From: "Bork, Chef" <issue_tracker@your.tracker.email.domain.example> |
| 236 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 236 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 237 MIME-Version: 1.0 | 237 MIME-Version: 1.0 |
| 238 Message-Id: <dummy_test_message_id> | 238 Message-Id: <dummy_test_message_id> |
| 239 X-Roundup-Name: Roundup issue tracker | 239 X-Roundup-Name: Roundup issue tracker |
| 269 | 269 |
| 270 This is a test submission of a new issue. | 270 This is a test submission of a new issue. |
| 271 ''') | 271 ''') |
| 272 self.compareMessages(self._get_mail(), | 272 self.compareMessages(self._get_mail(), |
| 273 '''FROM: roundup-admin@your.tracker.email.domain.example | 273 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 274 TO: chef@bork.bork.bork, mary@test, richard@test | 274 TO: chef@bork.bork.bork, mary@test.test, richard@test.test |
| 275 Content-Type: text/plain; charset=utf-8 | 275 Content-Type: text/plain; charset=utf-8 |
| 276 Subject: [issue1] Testing... | 276 Subject: [issue1] Testing... |
| 277 To: mary@test, richard@test | 277 To: mary@test.test, richard@test.test |
| 278 From: "Bork, Chef" <issue_tracker@your.tracker.email.domain.example> | 278 From: "Bork, Chef" <issue_tracker@your.tracker.email.domain.example> |
| 279 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 279 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 280 MIME-Version: 1.0 | 280 MIME-Version: 1.0 |
| 281 Message-Id: <dummy_test_message_id> | 281 Message-Id: <dummy_test_message_id> |
| 282 X-Roundup-Name: Roundup issue tracker | 282 X-Roundup-Name: Roundup issue tracker |
| 309 | 309 |
| 310 This is a test submission of a new issue. | 310 This is a test submission of a new issue. |
| 311 ''') | 311 ''') |
| 312 self.compareMessages(self._get_mail(), | 312 self.compareMessages(self._get_mail(), |
| 313 '''FROM: roundup-admin@your.tracker.email.domain.example | 313 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 314 TO: chef@bork.bork.bork, mary@test, richard@test | 314 TO: chef@bork.bork.bork, mary@test.test, richard@test.test |
| 315 Content-Type: text/plain; charset=utf-8 | 315 Content-Type: text/plain; charset=utf-8 |
| 316 Subject: [issue1] Testing... | 316 Subject: [issue1] Testing... |
| 317 To: mary@test, richard@test | 317 To: mary@test.test, richard@test.test |
| 318 From: "Bork, Chef" <issue_tracker@your.tracker.email.domain.example> | 318 From: "Bork, Chef" <issue_tracker@your.tracker.email.domain.example> |
| 319 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 319 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 320 MIME-Version: 1.0 | 320 MIME-Version: 1.0 |
| 321 Message-Id: <dummy_test_message_id> | 321 Message-Id: <dummy_test_message_id> |
| 322 X-Roundup-Name: Roundup issue tracker | 322 X-Roundup-Name: Roundup issue tracker |
| 336 | 336 |
| 337 _______________________________________________________________________ | 337 _______________________________________________________________________ |
| 338 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 338 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 339 <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1> | 339 <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1> |
| 340 _______________________________________________________________________ | 340 _______________________________________________________________________ |
| 341 ''') | 341 ''') |
| 342 | 342 |
| 343 # BUG | 343 # BUG |
| 344 # def testMultipart(self): | 344 # def testMultipart(self): |
| 345 # '''With more than one part''' | 345 # '''With more than one part''' |
| 346 # see MultipartEnc tests: but if there is more than one part | 346 # see MultipartEnc tests: but if there is more than one part |
| 351 | 351 |
| 352 def testSimpleFollowup(self): | 352 def testSimpleFollowup(self): |
| 353 self.doNewIssue() | 353 self.doNewIssue() |
| 354 self._handle_mail('''Content-Type: text/plain; | 354 self._handle_mail('''Content-Type: text/plain; |
| 355 charset="iso-8859-1" | 355 charset="iso-8859-1" |
| 356 From: mary <mary@test> | 356 From: mary <mary@test.test> |
| 357 To: issue_tracker@your.tracker.email.domain.example | 357 To: issue_tracker@your.tracker.email.domain.example |
| 358 Message-Id: <followup_dummy_id> | 358 Message-Id: <followup_dummy_id> |
| 359 In-Reply-To: <dummy_test_message_id> | 359 In-Reply-To: <dummy_test_message_id> |
| 360 Subject: [issue1] Testing... | 360 Subject: [issue1] Testing... |
| 361 | 361 |
| 362 This is a second followup | 362 This is a second followup |
| 363 ''') | 363 ''') |
| 364 self.compareMessages(self._get_mail(), | 364 self.compareMessages(self._get_mail(), |
| 365 '''FROM: roundup-admin@your.tracker.email.domain.example | 365 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 366 TO: chef@bork.bork.bork, richard@test | 366 TO: chef@bork.bork.bork, richard@test.test |
| 367 Content-Type: text/plain; charset=utf-8 | 367 Content-Type: text/plain; charset=utf-8 |
| 368 Subject: [issue1] Testing... | 368 Subject: [issue1] Testing... |
| 369 To: chef@bork.bork.bork, richard@test | 369 To: chef@bork.bork.bork, richard@test.test |
| 370 From: "Contrary, Mary" <issue_tracker@your.tracker.email.domain.example> | 370 From: "Contrary, Mary" <issue_tracker@your.tracker.email.domain.example> |
| 371 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 371 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 372 MIME-Version: 1.0 | 372 MIME-Version: 1.0 |
| 373 Message-Id: <followup_dummy_id> | 373 Message-Id: <followup_dummy_id> |
| 374 In-Reply-To: <dummy_test_message_id> | 374 In-Reply-To: <dummy_test_message_id> |
| 375 X-Roundup-Name: Roundup issue tracker | 375 X-Roundup-Name: Roundup issue tracker |
| 376 X-Roundup-Loop: hello | 376 X-Roundup-Loop: hello |
| 377 Content-Transfer-Encoding: quoted-printable | 377 Content-Transfer-Encoding: quoted-printable |
| 378 | 378 |
| 379 | 379 |
| 380 Contrary, Mary <mary@test> added the comment: | 380 Contrary, Mary <mary@test.test> added the comment: |
| 381 | 381 |
| 382 This is a second followup | 382 This is a second followup |
| 383 | 383 |
| 384 ---------- | 384 ---------- |
| 385 status: unread -> chatting | 385 status: unread -> chatting |
| 393 def testFollowup(self): | 393 def testFollowup(self): |
| 394 self.doNewIssue() | 394 self.doNewIssue() |
| 395 | 395 |
| 396 self._handle_mail('''Content-Type: text/plain; | 396 self._handle_mail('''Content-Type: text/plain; |
| 397 charset="iso-8859-1" | 397 charset="iso-8859-1" |
| 398 From: richard <richard@test> | 398 From: richard <richard@test.test> |
| 399 To: issue_tracker@your.tracker.email.domain.example | 399 To: issue_tracker@your.tracker.email.domain.example |
| 400 Message-Id: <followup_dummy_id> | 400 Message-Id: <followup_dummy_id> |
| 401 In-Reply-To: <dummy_test_message_id> | 401 In-Reply-To: <dummy_test_message_id> |
| 402 Subject: [issue1] Testing... [assignedto=mary; nosy=+john] | 402 Subject: [issue1] Testing... [assignedto=mary; nosy=+john] |
| 403 | 403 |
| 408 self.assertEqual(l, [self.chef_id, self.richard_id, self.mary_id, | 408 self.assertEqual(l, [self.chef_id, self.richard_id, self.mary_id, |
| 409 self.john_id]) | 409 self.john_id]) |
| 410 | 410 |
| 411 self.compareMessages(self._get_mail(), | 411 self.compareMessages(self._get_mail(), |
| 412 '''FROM: roundup-admin@your.tracker.email.domain.example | 412 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 413 TO: chef@bork.bork.bork, john@test, mary@test | 413 TO: chef@bork.bork.bork, john@test.test, mary@test.test |
| 414 Content-Type: text/plain; charset=utf-8 | 414 Content-Type: text/plain; charset=utf-8 |
| 415 Subject: [issue1] Testing... | 415 Subject: [issue1] Testing... |
| 416 To: chef@bork.bork.bork, john@test, mary@test | 416 To: chef@bork.bork.bork, john@test.test, mary@test.test |
| 417 From: richard <issue_tracker@your.tracker.email.domain.example> | 417 From: richard <issue_tracker@your.tracker.email.domain.example> |
| 418 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 418 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 419 MIME-Version: 1.0 | 419 MIME-Version: 1.0 |
| 420 Message-Id: <followup_dummy_id> | 420 Message-Id: <followup_dummy_id> |
| 421 In-Reply-To: <dummy_test_message_id> | 421 In-Reply-To: <dummy_test_message_id> |
| 422 X-Roundup-Name: Roundup issue tracker | 422 X-Roundup-Name: Roundup issue tracker |
| 423 X-Roundup-Loop: hello | 423 X-Roundup-Loop: hello |
| 424 Content-Transfer-Encoding: quoted-printable | 424 Content-Transfer-Encoding: quoted-printable |
| 425 | 425 |
| 426 | 426 |
| 427 richard <richard@test> added the comment: | 427 richard <richard@test.test> added the comment: |
| 428 | 428 |
| 429 This is a followup | 429 This is a followup |
| 430 | 430 |
| 431 ---------- | 431 ---------- |
| 432 assignedto: -> mary | 432 assignedto: -> mary |
| 456 continue | 456 continue |
| 457 new_mail+=line+"\n" | 457 new_mail+=line+"\n" |
| 458 | 458 |
| 459 self.compareMessages(new_mail, """ | 459 self.compareMessages(new_mail, """ |
| 460 FROM: roundup-admin@your.tracker.email.domain.example | 460 FROM: roundup-admin@your.tracker.email.domain.example |
| 461 TO: chef@bork.bork.bork, richard@test | 461 TO: chef@bork.bork.bork, richard@test.test |
| 462 Content-Type: text/plain; charset=utf-8 | 462 Content-Type: text/plain; charset=utf-8 |
| 463 Subject: [issue1] Testing... | 463 Subject: [issue1] Testing... |
| 464 To: chef@bork.bork.bork, richard@test | 464 To: chef@bork.bork.bork, richard@test.test |
| 465 From: "Bork, Chef" <issue_tracker@your.tracker.email.domain.example> | 465 From: "Bork, Chef" <issue_tracker@your.tracker.email.domain.example> |
| 466 X-Roundup-Name: Roundup issue tracker | 466 X-Roundup-Name: Roundup issue tracker |
| 467 X-Roundup-Loop: hello | 467 X-Roundup-Loop: hello |
| 468 X-Roundup-Version: 1.3.3 | 468 X-Roundup-Version: 1.3.3 |
| 469 MIME-Version: 1.0 | 469 MIME-Version: 1.0 |
| 489 # | 489 # |
| 490 def testFollowupTitleMatch(self): | 490 def testFollowupTitleMatch(self): |
| 491 self.doNewIssue() | 491 self.doNewIssue() |
| 492 self._handle_mail('''Content-Type: text/plain; | 492 self._handle_mail('''Content-Type: text/plain; |
| 493 charset="iso-8859-1" | 493 charset="iso-8859-1" |
| 494 From: richard <richard@test> | 494 From: richard <richard@test.test> |
| 495 To: issue_tracker@your.tracker.email.domain.example | 495 To: issue_tracker@your.tracker.email.domain.example |
| 496 Message-Id: <followup_dummy_id> | 496 Message-Id: <followup_dummy_id> |
| 497 Subject: Re: Testing... [assignedto=mary; nosy=+john] | 497 Subject: Re: Testing... [assignedto=mary; nosy=+john] |
| 498 | 498 |
| 499 This is a followup | 499 This is a followup |
| 500 ''') | 500 ''') |
| 501 self.compareMessages(self._get_mail(), | 501 self.compareMessages(self._get_mail(), |
| 502 '''FROM: roundup-admin@your.tracker.email.domain.example | 502 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 503 TO: chef@bork.bork.bork, john@test, mary@test | 503 TO: chef@bork.bork.bork, john@test.test, mary@test.test |
| 504 Content-Type: text/plain; charset=utf-8 | 504 Content-Type: text/plain; charset=utf-8 |
| 505 Subject: [issue1] Testing... | 505 Subject: [issue1] Testing... |
| 506 To: chef@bork.bork.bork, john@test, mary@test | 506 To: chef@bork.bork.bork, john@test.test, mary@test.test |
| 507 From: richard <issue_tracker@your.tracker.email.domain.example> | 507 From: richard <issue_tracker@your.tracker.email.domain.example> |
| 508 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 508 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 509 MIME-Version: 1.0 | 509 MIME-Version: 1.0 |
| 510 Message-Id: <followup_dummy_id> | 510 Message-Id: <followup_dummy_id> |
| 511 In-Reply-To: <dummy_test_message_id> | 511 In-Reply-To: <dummy_test_message_id> |
| 512 X-Roundup-Name: Roundup issue tracker | 512 X-Roundup-Name: Roundup issue tracker |
| 513 X-Roundup-Loop: hello | 513 X-Roundup-Loop: hello |
| 514 Content-Transfer-Encoding: quoted-printable | 514 Content-Transfer-Encoding: quoted-printable |
| 515 | 515 |
| 516 | 516 |
| 517 richard <richard@test> added the comment: | 517 richard <richard@test.test> added the comment: |
| 518 | 518 |
| 519 This is a followup | 519 This is a followup |
| 520 | 520 |
| 521 ---------- | 521 ---------- |
| 522 assignedto: -> mary | 522 assignedto: -> mary |
| 531 | 531 |
| 532 def testFollowupTitleMatchMultiRe(self): | 532 def testFollowupTitleMatchMultiRe(self): |
| 533 nodeid1 = self.doNewIssue() | 533 nodeid1 = self.doNewIssue() |
| 534 nodeid2 = self._handle_mail('''Content-Type: text/plain; | 534 nodeid2 = self._handle_mail('''Content-Type: text/plain; |
| 535 charset="iso-8859-1" | 535 charset="iso-8859-1" |
| 536 From: richard <richard@test> | 536 From: richard <richard@test.test> |
| 537 To: issue_tracker@your.tracker.email.domain.example | 537 To: issue_tracker@your.tracker.email.domain.example |
| 538 Message-Id: <followup_dummy_id> | 538 Message-Id: <followup_dummy_id> |
| 539 Subject: Re: Testing... [assignedto=mary; nosy=+john] | 539 Subject: Re: Testing... [assignedto=mary; nosy=+john] |
| 540 | 540 |
| 541 This is a followup | 541 This is a followup |
| 542 ''') | 542 ''') |
| 543 | 543 |
| 544 nodeid3 = self._handle_mail('''Content-Type: text/plain; | 544 nodeid3 = self._handle_mail('''Content-Type: text/plain; |
| 545 charset="iso-8859-1" | 545 charset="iso-8859-1" |
| 546 From: richard <richard@test> | 546 From: richard <richard@test.test> |
| 547 To: issue_tracker@your.tracker.email.domain.example | 547 To: issue_tracker@your.tracker.email.domain.example |
| 548 Message-Id: <followup2_dummy_id> | 548 Message-Id: <followup2_dummy_id> |
| 549 Subject: Ang: Re: Testing... | 549 Subject: Ang: Re: Testing... |
| 550 | 550 |
| 551 This is a followup | 551 This is a followup |
| 552 ''') | 552 ''') |
| 553 self.assertEqual(nodeid1, nodeid2) | 553 self.assertEqual(nodeid1, nodeid2) |
| 554 self.assertEqual(nodeid1, nodeid3) | 554 self.assertEqual(nodeid1, nodeid3) |
| 555 | 555 |
| 556 def testFollowupTitleMatchNever(self): | 556 def testFollowupTitleMatchNever(self): |
| 557 nodeid = self.doNewIssue() | 557 nodeid = self.doNewIssue() |
| 558 self.db.config.MAILGW_SUBJECT_CONTENT_MATCH = 'never' | 558 self.db.config.MAILGW_SUBJECT_CONTENT_MATCH = 'never' |
| 559 self.assertNotEqual(self._handle_mail('''Content-Type: text/plain; | 559 self.assertNotEqual(self._handle_mail('''Content-Type: text/plain; |
| 560 charset="iso-8859-1" | 560 charset="iso-8859-1" |
| 561 From: richard <richard@test> | 561 From: richard <richard@test.test> |
| 562 To: issue_tracker@your.tracker.email.domain.example | 562 To: issue_tracker@your.tracker.email.domain.example |
| 563 Message-Id: <followup_dummy_id> | 563 Message-Id: <followup_dummy_id> |
| 564 Subject: Re: Testing... | 564 Subject: Re: Testing... |
| 565 | 565 |
| 566 This is a followup | 566 This is a followup |
| 571 # force failure of the interval | 571 # force failure of the interval |
| 572 time.sleep(2) | 572 time.sleep(2) |
| 573 self.db.config.MAILGW_SUBJECT_CONTENT_MATCH = 'creation 00:00:01' | 573 self.db.config.MAILGW_SUBJECT_CONTENT_MATCH = 'creation 00:00:01' |
| 574 self.assertNotEqual(self._handle_mail('''Content-Type: text/plain; | 574 self.assertNotEqual(self._handle_mail('''Content-Type: text/plain; |
| 575 charset="iso-8859-1" | 575 charset="iso-8859-1" |
| 576 From: richard <richard@test> | 576 From: richard <richard@test.test> |
| 577 To: issue_tracker@your.tracker.email.domain.example | 577 To: issue_tracker@your.tracker.email.domain.example |
| 578 Message-Id: <followup_dummy_id> | 578 Message-Id: <followup_dummy_id> |
| 579 Subject: Re: Testing... | 579 Subject: Re: Testing... |
| 580 | 580 |
| 581 This is a followup | 581 This is a followup |
| 582 '''), nodeid) | 582 '''), nodeid) |
| 583 # now try a longer interval | 583 # now try a longer interval |
| 584 self.db.config.MAILGW_SUBJECT_CONTENT_MATCH = 'creation +1d' | 584 self.db.config.MAILGW_SUBJECT_CONTENT_MATCH = 'creation +1d' |
| 585 self.assertEqual(self._handle_mail('''Content-Type: text/plain; | 585 self.assertEqual(self._handle_mail('''Content-Type: text/plain; |
| 586 charset="iso-8859-1" | 586 charset="iso-8859-1" |
| 587 From: richard <richard@test> | 587 From: richard <richard@test.test> |
| 588 To: issue_tracker@your.tracker.email.domain.example | 588 To: issue_tracker@your.tracker.email.domain.example |
| 589 Message-Id: <followup_dummy_id> | 589 Message-Id: <followup_dummy_id> |
| 590 Subject: Re: Testing... | 590 Subject: Re: Testing... |
| 591 | 591 |
| 592 This is a followup | 592 This is a followup |
| 596 def testFollowupNosyAuthor(self): | 596 def testFollowupNosyAuthor(self): |
| 597 self.doNewIssue() | 597 self.doNewIssue() |
| 598 self.db.config.ADD_AUTHOR_TO_NOSY = 'yes' | 598 self.db.config.ADD_AUTHOR_TO_NOSY = 'yes' |
| 599 self._handle_mail('''Content-Type: text/plain; | 599 self._handle_mail('''Content-Type: text/plain; |
| 600 charset="iso-8859-1" | 600 charset="iso-8859-1" |
| 601 From: john@test | 601 From: john@test.test |
| 602 To: issue_tracker@your.tracker.email.domain.example | 602 To: issue_tracker@your.tracker.email.domain.example |
| 603 Message-Id: <followup_dummy_id> | 603 Message-Id: <followup_dummy_id> |
| 604 In-Reply-To: <dummy_test_message_id> | 604 In-Reply-To: <dummy_test_message_id> |
| 605 Subject: [issue1] Testing... | 605 Subject: [issue1] Testing... |
| 606 | 606 |
| 607 This is a followup | 607 This is a followup |
| 608 ''') | 608 ''') |
| 609 | 609 |
| 610 self.compareMessages(self._get_mail(), | 610 self.compareMessages(self._get_mail(), |
| 611 '''FROM: roundup-admin@your.tracker.email.domain.example | 611 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 612 TO: chef@bork.bork.bork, richard@test | 612 TO: chef@bork.bork.bork, richard@test.test |
| 613 Content-Type: text/plain; charset=utf-8 | 613 Content-Type: text/plain; charset=utf-8 |
| 614 Subject: [issue1] Testing... | 614 Subject: [issue1] Testing... |
| 615 To: chef@bork.bork.bork, richard@test | 615 To: chef@bork.bork.bork, richard@test.test |
| 616 From: John Doe <issue_tracker@your.tracker.email.domain.example> | 616 From: John Doe <issue_tracker@your.tracker.email.domain.example> |
| 617 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 617 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 618 MIME-Version: 1.0 | 618 MIME-Version: 1.0 |
| 619 Message-Id: <followup_dummy_id> | 619 Message-Id: <followup_dummy_id> |
| 620 In-Reply-To: <dummy_test_message_id> | 620 In-Reply-To: <dummy_test_message_id> |
| 621 X-Roundup-Name: Roundup issue tracker | 621 X-Roundup-Name: Roundup issue tracker |
| 622 X-Roundup-Loop: hello | 622 X-Roundup-Loop: hello |
| 623 Content-Transfer-Encoding: quoted-printable | 623 Content-Transfer-Encoding: quoted-printable |
| 624 | 624 |
| 625 | 625 |
| 626 John Doe <john@test> added the comment: | 626 John Doe <john@test.test> added the comment: |
| 627 | 627 |
| 628 This is a followup | 628 This is a followup |
| 629 | 629 |
| 630 ---------- | 630 ---------- |
| 631 nosy: +john | 631 nosy: +john |
| 641 def testFollowupNosyRecipients(self): | 641 def testFollowupNosyRecipients(self): |
| 642 self.doNewIssue() | 642 self.doNewIssue() |
| 643 self.db.config.ADD_RECIPIENTS_TO_NOSY = 'yes' | 643 self.db.config.ADD_RECIPIENTS_TO_NOSY = 'yes' |
| 644 self._handle_mail('''Content-Type: text/plain; | 644 self._handle_mail('''Content-Type: text/plain; |
| 645 charset="iso-8859-1" | 645 charset="iso-8859-1" |
| 646 From: richard@test | 646 From: richard@test.test |
| 647 To: issue_tracker@your.tracker.email.domain.example | 647 To: issue_tracker@your.tracker.email.domain.example |
| 648 Cc: john@test | 648 Cc: john@test.test |
| 649 Message-Id: <followup_dummy_id> | 649 Message-Id: <followup_dummy_id> |
| 650 In-Reply-To: <dummy_test_message_id> | 650 In-Reply-To: <dummy_test_message_id> |
| 651 Subject: [issue1] Testing... | 651 Subject: [issue1] Testing... |
| 652 | 652 |
| 653 This is a followup | 653 This is a followup |
| 666 X-Roundup-Name: Roundup issue tracker | 666 X-Roundup-Name: Roundup issue tracker |
| 667 X-Roundup-Loop: hello | 667 X-Roundup-Loop: hello |
| 668 Content-Transfer-Encoding: quoted-printable | 668 Content-Transfer-Encoding: quoted-printable |
| 669 | 669 |
| 670 | 670 |
| 671 richard <richard@test> added the comment: | 671 richard <richard@test.test> added the comment: |
| 672 | 672 |
| 673 This is a followup | 673 This is a followup |
| 674 | 674 |
| 675 ---------- | 675 ---------- |
| 676 nosy: +john | 676 nosy: +john |
| 687 self.doNewIssue() | 687 self.doNewIssue() |
| 688 self.db.config.ADD_AUTHOR_TO_NOSY = 'yes' | 688 self.db.config.ADD_AUTHOR_TO_NOSY = 'yes' |
| 689 self.db.config.MESSAGES_TO_AUTHOR = 'yes' | 689 self.db.config.MESSAGES_TO_AUTHOR = 'yes' |
| 690 self._handle_mail('''Content-Type: text/plain; | 690 self._handle_mail('''Content-Type: text/plain; |
| 691 charset="iso-8859-1" | 691 charset="iso-8859-1" |
| 692 From: john@test | 692 From: john@test.test |
| 693 To: issue_tracker@your.tracker.email.domain.example | 693 To: issue_tracker@your.tracker.email.domain.example |
| 694 Message-Id: <followup_dummy_id> | 694 Message-Id: <followup_dummy_id> |
| 695 In-Reply-To: <dummy_test_message_id> | 695 In-Reply-To: <dummy_test_message_id> |
| 696 Subject: [issue1] Testing... | 696 Subject: [issue1] Testing... |
| 697 | 697 |
| 698 This is a followup | 698 This is a followup |
| 699 ''') | 699 ''') |
| 700 self.compareMessages(self._get_mail(), | 700 self.compareMessages(self._get_mail(), |
| 701 '''FROM: roundup-admin@your.tracker.email.domain.example | 701 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 702 TO: chef@bork.bork.bork, john@test, richard@test | 702 TO: chef@bork.bork.bork, john@test.test, richard@test.test |
| 703 Content-Type: text/plain; charset=utf-8 | 703 Content-Type: text/plain; charset=utf-8 |
| 704 Subject: [issue1] Testing... | 704 Subject: [issue1] Testing... |
| 705 To: chef@bork.bork.bork, john@test, richard@test | 705 To: chef@bork.bork.bork, john@test.test, richard@test.test |
| 706 From: John Doe <issue_tracker@your.tracker.email.domain.example> | 706 From: John Doe <issue_tracker@your.tracker.email.domain.example> |
| 707 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 707 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 708 MIME-Version: 1.0 | 708 MIME-Version: 1.0 |
| 709 Message-Id: <followup_dummy_id> | 709 Message-Id: <followup_dummy_id> |
| 710 In-Reply-To: <dummy_test_message_id> | 710 In-Reply-To: <dummy_test_message_id> |
| 711 X-Roundup-Name: Roundup issue tracker | 711 X-Roundup-Name: Roundup issue tracker |
| 712 X-Roundup-Loop: hello | 712 X-Roundup-Loop: hello |
| 713 Content-Transfer-Encoding: quoted-printable | 713 Content-Transfer-Encoding: quoted-printable |
| 714 | 714 |
| 715 | 715 |
| 716 John Doe <john@test> added the comment: | 716 John Doe <john@test.test> added the comment: |
| 717 | 717 |
| 718 This is a followup | 718 This is a followup |
| 719 | 719 |
| 720 ---------- | 720 ---------- |
| 721 nosy: +john | 721 nosy: +john |
| 731 def testFollowupNoNosyAuthor(self): | 731 def testFollowupNoNosyAuthor(self): |
| 732 self.doNewIssue() | 732 self.doNewIssue() |
| 733 self.instance.config.ADD_AUTHOR_TO_NOSY = 'no' | 733 self.instance.config.ADD_AUTHOR_TO_NOSY = 'no' |
| 734 self._handle_mail('''Content-Type: text/plain; | 734 self._handle_mail('''Content-Type: text/plain; |
| 735 charset="iso-8859-1" | 735 charset="iso-8859-1" |
| 736 From: john@test | 736 From: john@test.test |
| 737 To: issue_tracker@your.tracker.email.domain.example | 737 To: issue_tracker@your.tracker.email.domain.example |
| 738 Message-Id: <followup_dummy_id> | 738 Message-Id: <followup_dummy_id> |
| 739 In-Reply-To: <dummy_test_message_id> | 739 In-Reply-To: <dummy_test_message_id> |
| 740 Subject: [issue1] Testing... | 740 Subject: [issue1] Testing... |
| 741 | 741 |
| 742 This is a followup | 742 This is a followup |
| 743 ''') | 743 ''') |
| 744 self.compareMessages(self._get_mail(), | 744 self.compareMessages(self._get_mail(), |
| 745 '''FROM: roundup-admin@your.tracker.email.domain.example | 745 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 746 TO: chef@bork.bork.bork, richard@test | 746 TO: chef@bork.bork.bork, richard@test.test |
| 747 Content-Type: text/plain; charset=utf-8 | 747 Content-Type: text/plain; charset=utf-8 |
| 748 Subject: [issue1] Testing... | 748 Subject: [issue1] Testing... |
| 749 To: chef@bork.bork.bork, richard@test | 749 To: chef@bork.bork.bork, richard@test.test |
| 750 From: John Doe <issue_tracker@your.tracker.email.domain.example> | 750 From: John Doe <issue_tracker@your.tracker.email.domain.example> |
| 751 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 751 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 752 MIME-Version: 1.0 | 752 MIME-Version: 1.0 |
| 753 Message-Id: <followup_dummy_id> | 753 Message-Id: <followup_dummy_id> |
| 754 In-Reply-To: <dummy_test_message_id> | 754 In-Reply-To: <dummy_test_message_id> |
| 755 X-Roundup-Name: Roundup issue tracker | 755 X-Roundup-Name: Roundup issue tracker |
| 756 X-Roundup-Loop: hello | 756 X-Roundup-Loop: hello |
| 757 Content-Transfer-Encoding: quoted-printable | 757 Content-Transfer-Encoding: quoted-printable |
| 758 | 758 |
| 759 | 759 |
| 760 John Doe <john@test> added the comment: | 760 John Doe <john@test.test> added the comment: |
| 761 | 761 |
| 762 This is a followup | 762 This is a followup |
| 763 | 763 |
| 764 ---------- | 764 ---------- |
| 765 status: unread -> chatting | 765 status: unread -> chatting |
| 774 def testFollowupNoNosyRecipients(self): | 774 def testFollowupNoNosyRecipients(self): |
| 775 self.doNewIssue() | 775 self.doNewIssue() |
| 776 self.instance.config.ADD_RECIPIENTS_TO_NOSY = 'no' | 776 self.instance.config.ADD_RECIPIENTS_TO_NOSY = 'no' |
| 777 self._handle_mail('''Content-Type: text/plain; | 777 self._handle_mail('''Content-Type: text/plain; |
| 778 charset="iso-8859-1" | 778 charset="iso-8859-1" |
| 779 From: richard@test | 779 From: richard@test.test |
| 780 To: issue_tracker@your.tracker.email.domain.example | 780 To: issue_tracker@your.tracker.email.domain.example |
| 781 Cc: john@test | 781 Cc: john@test.test |
| 782 Message-Id: <followup_dummy_id> | 782 Message-Id: <followup_dummy_id> |
| 783 In-Reply-To: <dummy_test_message_id> | 783 In-Reply-To: <dummy_test_message_id> |
| 784 Subject: [issue1] Testing... | 784 Subject: [issue1] Testing... |
| 785 | 785 |
| 786 This is a followup | 786 This is a followup |
| 799 X-Roundup-Name: Roundup issue tracker | 799 X-Roundup-Name: Roundup issue tracker |
| 800 X-Roundup-Loop: hello | 800 X-Roundup-Loop: hello |
| 801 Content-Transfer-Encoding: quoted-printable | 801 Content-Transfer-Encoding: quoted-printable |
| 802 | 802 |
| 803 | 803 |
| 804 richard <richard@test> added the comment: | 804 richard <richard@test.test> added the comment: |
| 805 | 805 |
| 806 This is a followup | 806 This is a followup |
| 807 | 807 |
| 808 ---------- | 808 ---------- |
| 809 status: unread -> chatting | 809 status: unread -> chatting |
| 818 def testFollowupEmptyMessage(self): | 818 def testFollowupEmptyMessage(self): |
| 819 self.doNewIssue() | 819 self.doNewIssue() |
| 820 | 820 |
| 821 self._handle_mail('''Content-Type: text/plain; | 821 self._handle_mail('''Content-Type: text/plain; |
| 822 charset="iso-8859-1" | 822 charset="iso-8859-1" |
| 823 From: richard <richard@test> | 823 From: richard <richard@test.test> |
| 824 To: issue_tracker@your.tracker.email.domain.example | 824 To: issue_tracker@your.tracker.email.domain.example |
| 825 Message-Id: <followup_dummy_id> | 825 Message-Id: <followup_dummy_id> |
| 826 In-Reply-To: <dummy_test_message_id> | 826 In-Reply-To: <dummy_test_message_id> |
| 827 Subject: [issue1] Testing... [assignedto=mary; nosy=+john] | 827 Subject: [issue1] Testing... [assignedto=mary; nosy=+john] |
| 828 | 828 |
| 838 def testFollowupEmptyMessageNoSubject(self): | 838 def testFollowupEmptyMessageNoSubject(self): |
| 839 self.doNewIssue() | 839 self.doNewIssue() |
| 840 | 840 |
| 841 self._handle_mail('''Content-Type: text/plain; | 841 self._handle_mail('''Content-Type: text/plain; |
| 842 charset="iso-8859-1" | 842 charset="iso-8859-1" |
| 843 From: richard <richard@test> | 843 From: richard <richard@test.test> |
| 844 To: issue_tracker@your.tracker.email.domain.example | 844 To: issue_tracker@your.tracker.email.domain.example |
| 845 Message-Id: <followup_dummy_id> | 845 Message-Id: <followup_dummy_id> |
| 846 In-Reply-To: <dummy_test_message_id> | 846 In-Reply-To: <dummy_test_message_id> |
| 847 Subject: [issue1] [assignedto=mary; nosy=+john] | 847 Subject: [issue1] [assignedto=mary; nosy=+john] |
| 848 | 848 |
| 858 def testNosyRemove(self): | 858 def testNosyRemove(self): |
| 859 self.doNewIssue() | 859 self.doNewIssue() |
| 860 | 860 |
| 861 self._handle_mail('''Content-Type: text/plain; | 861 self._handle_mail('''Content-Type: text/plain; |
| 862 charset="iso-8859-1" | 862 charset="iso-8859-1" |
| 863 From: richard <richard@test> | 863 From: richard <richard@test.test> |
| 864 To: issue_tracker@your.tracker.email.domain.example | 864 To: issue_tracker@your.tracker.email.domain.example |
| 865 Message-Id: <followup_dummy_id> | 865 Message-Id: <followup_dummy_id> |
| 866 In-Reply-To: <dummy_test_message_id> | 866 In-Reply-To: <dummy_test_message_id> |
| 867 Subject: [issue1] Testing... [nosy=-richard] | 867 Subject: [issue1] Testing... [nosy=-richard] |
| 868 | 868 |
| 894 ''' | 894 ''' |
| 895 try: | 895 try: |
| 896 self._handle_mail(message) | 896 self._handle_mail(message) |
| 897 except Unauthorized, value: | 897 except Unauthorized, value: |
| 898 body_diff = self.compareMessages(str(value), """ | 898 body_diff = self.compareMessages(str(value), """ |
| 899 You are not a registered user. | 899 You are not a registered user. |
| 900 | 900 |
| 901 Unknown address: fubar@bork.bork.bork | 901 Unknown address: fubar@bork.bork.bork |
| 902 """) | 902 """) |
| 903 | 903 |
| 904 assert not body_diff, body_diff | 904 assert not body_diff, body_diff |
| 951 | 951 |
| 952 def testEnc01(self): | 952 def testEnc01(self): |
| 953 self.doNewIssue() | 953 self.doNewIssue() |
| 954 self._handle_mail('''Content-Type: text/plain; | 954 self._handle_mail('''Content-Type: text/plain; |
| 955 charset="iso-8859-1" | 955 charset="iso-8859-1" |
| 956 From: mary <mary@test> | 956 From: mary <mary@test.test> |
| 957 To: issue_tracker@your.tracker.email.domain.example | 957 To: issue_tracker@your.tracker.email.domain.example |
| 958 Message-Id: <followup_dummy_id> | 958 Message-Id: <followup_dummy_id> |
| 959 In-Reply-To: <dummy_test_message_id> | 959 In-Reply-To: <dummy_test_message_id> |
| 960 Subject: [issue1] Testing... | 960 Subject: [issue1] Testing... |
| 961 Content-Type: text/plain; | 961 Content-Type: text/plain; |
| 965 A message with encoding (encoded oe =F6) | 965 A message with encoding (encoded oe =F6) |
| 966 | 966 |
| 967 ''') | 967 ''') |
| 968 self.compareMessages(self._get_mail(), | 968 self.compareMessages(self._get_mail(), |
| 969 '''FROM: roundup-admin@your.tracker.email.domain.example | 969 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 970 TO: chef@bork.bork.bork, richard@test | 970 TO: chef@bork.bork.bork, richard@test.test |
| 971 Content-Type: text/plain; charset=utf-8 | 971 Content-Type: text/plain; charset=utf-8 |
| 972 Subject: [issue1] Testing... | 972 Subject: [issue1] Testing... |
| 973 To: chef@bork.bork.bork, richard@test | 973 To: chef@bork.bork.bork, richard@test.test |
| 974 From: "Contrary, Mary" <issue_tracker@your.tracker.email.domain.example> | 974 From: "Contrary, Mary" <issue_tracker@your.tracker.email.domain.example> |
| 975 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 975 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 976 MIME-Version: 1.0 | 976 MIME-Version: 1.0 |
| 977 Message-Id: <followup_dummy_id> | 977 Message-Id: <followup_dummy_id> |
| 978 In-Reply-To: <dummy_test_message_id> | 978 In-Reply-To: <dummy_test_message_id> |
| 979 X-Roundup-Name: Roundup issue tracker | 979 X-Roundup-Name: Roundup issue tracker |
| 980 X-Roundup-Loop: hello | 980 X-Roundup-Loop: hello |
| 981 Content-Transfer-Encoding: quoted-printable | 981 Content-Transfer-Encoding: quoted-printable |
| 982 | 982 |
| 983 | 983 |
| 984 Contrary, Mary <mary@test> added the comment: | 984 Contrary, Mary <mary@test.test> added the comment: |
| 985 | 985 |
| 986 A message with encoding (encoded oe =C3=B6) | 986 A message with encoding (encoded oe =C3=B6) |
| 987 | 987 |
| 988 ---------- | 988 ---------- |
| 989 status: unread -> chatting | 989 status: unread -> chatting |
| 997 | 997 |
| 998 def testMultipartEnc01(self): | 998 def testMultipartEnc01(self): |
| 999 self.doNewIssue() | 999 self.doNewIssue() |
| 1000 self._handle_mail('''Content-Type: text/plain; | 1000 self._handle_mail('''Content-Type: text/plain; |
| 1001 charset="iso-8859-1" | 1001 charset="iso-8859-1" |
| 1002 From: mary <mary@test> | 1002 From: mary <mary@test.test> |
| 1003 To: issue_tracker@your.tracker.email.domain.example | 1003 To: issue_tracker@your.tracker.email.domain.example |
| 1004 Message-Id: <followup_dummy_id> | 1004 Message-Id: <followup_dummy_id> |
| 1005 In-Reply-To: <dummy_test_message_id> | 1005 In-Reply-To: <dummy_test_message_id> |
| 1006 Subject: [issue1] Testing... | 1006 Subject: [issue1] Testing... |
| 1007 Content-Type: multipart/mixed; | 1007 Content-Type: multipart/mixed; |
| 1018 A message with first part encoded (encoded oe =F6) | 1018 A message with first part encoded (encoded oe =F6) |
| 1019 | 1019 |
| 1020 ''') | 1020 ''') |
| 1021 self.compareMessages(self._get_mail(), | 1021 self.compareMessages(self._get_mail(), |
| 1022 '''FROM: roundup-admin@your.tracker.email.domain.example | 1022 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 1023 TO: chef@bork.bork.bork, richard@test | 1023 TO: chef@bork.bork.bork, richard@test.test |
| 1024 Content-Type: text/plain; charset=utf-8 | 1024 Content-Type: text/plain; charset=utf-8 |
| 1025 Subject: [issue1] Testing... | 1025 Subject: [issue1] Testing... |
| 1026 To: chef@bork.bork.bork, richard@test | 1026 To: chef@bork.bork.bork, richard@test.test |
| 1027 From: "Contrary, Mary" <issue_tracker@your.tracker.email.domain.example> | 1027 From: "Contrary, Mary" <issue_tracker@your.tracker.email.domain.example> |
| 1028 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 1028 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 1029 MIME-Version: 1.0 | 1029 MIME-Version: 1.0 |
| 1030 Message-Id: <followup_dummy_id> | 1030 Message-Id: <followup_dummy_id> |
| 1031 In-Reply-To: <dummy_test_message_id> | 1031 In-Reply-To: <dummy_test_message_id> |
| 1032 X-Roundup-Name: Roundup issue tracker | 1032 X-Roundup-Name: Roundup issue tracker |
| 1033 X-Roundup-Loop: hello | 1033 X-Roundup-Loop: hello |
| 1034 Content-Transfer-Encoding: quoted-printable | 1034 Content-Transfer-Encoding: quoted-printable |
| 1035 | 1035 |
| 1036 | 1036 |
| 1037 Contrary, Mary <mary@test> added the comment: | 1037 Contrary, Mary <mary@test.test> added the comment: |
| 1038 | 1038 |
| 1039 A message with first part encoded (encoded oe =C3=B6) | 1039 A message with first part encoded (encoded oe =C3=B6) |
| 1040 | 1040 |
| 1041 ---------- | 1041 ---------- |
| 1042 status: unread -> chatting | 1042 status: unread -> chatting |
| 1049 | 1049 |
| 1050 def testContentDisposition(self): | 1050 def testContentDisposition(self): |
| 1051 self.doNewIssue() | 1051 self.doNewIssue() |
| 1052 self._handle_mail('''Content-Type: text/plain; | 1052 self._handle_mail('''Content-Type: text/plain; |
| 1053 charset="iso-8859-1" | 1053 charset="iso-8859-1" |
| 1054 From: mary <mary@test> | 1054 From: mary <mary@test.test> |
| 1055 To: issue_tracker@your.tracker.email.domain.example | 1055 To: issue_tracker@your.tracker.email.domain.example |
| 1056 Message-Id: <followup_dummy_id> | 1056 Message-Id: <followup_dummy_id> |
| 1057 In-Reply-To: <dummy_test_message_id> | 1057 In-Reply-To: <dummy_test_message_id> |
| 1058 Subject: [issue1] Testing... | 1058 Subject: [issue1] Testing... |
| 1059 Content-Type: multipart/mixed; boundary="bCsyhTFzCvuiizWE" | 1059 Content-Type: multipart/mixed; boundary="bCsyhTFzCvuiizWE" |
| 1082 def testFollowupStupidQuoting(self): | 1082 def testFollowupStupidQuoting(self): |
| 1083 self.doNewIssue() | 1083 self.doNewIssue() |
| 1084 | 1084 |
| 1085 self._handle_mail('''Content-Type: text/plain; | 1085 self._handle_mail('''Content-Type: text/plain; |
| 1086 charset="iso-8859-1" | 1086 charset="iso-8859-1" |
| 1087 From: richard <richard@test> | 1087 From: richard <richard@test.test> |
| 1088 To: issue_tracker@your.tracker.email.domain.example | 1088 To: issue_tracker@your.tracker.email.domain.example |
| 1089 Message-Id: <followup_dummy_id> | 1089 Message-Id: <followup_dummy_id> |
| 1090 In-Reply-To: <dummy_test_message_id> | 1090 In-Reply-To: <dummy_test_message_id> |
| 1091 Subject: Re: "[issue1] Testing... " | 1091 Subject: Re: "[issue1] Testing... " |
| 1092 | 1092 |
| 1106 X-Roundup-Name: Roundup issue tracker | 1106 X-Roundup-Name: Roundup issue tracker |
| 1107 X-Roundup-Loop: hello | 1107 X-Roundup-Loop: hello |
| 1108 Content-Transfer-Encoding: quoted-printable | 1108 Content-Transfer-Encoding: quoted-printable |
| 1109 | 1109 |
| 1110 | 1110 |
| 1111 richard <richard@test> added the comment: | 1111 richard <richard@test.test> added the comment: |
| 1112 | 1112 |
| 1113 This is a followup | 1113 This is a followup |
| 1114 | 1114 |
| 1115 ---------- | 1115 ---------- |
| 1116 status: unread -> chatting | 1116 status: unread -> chatting |
| 1141 | 1141 |
| 1142 messages = self.db.issue.get(nodeid, 'messages') | 1142 messages = self.db.issue.get(nodeid, 'messages') |
| 1143 | 1143 |
| 1144 self._handle_mail('''Content-Type: text/plain; | 1144 self._handle_mail('''Content-Type: text/plain; |
| 1145 charset="iso-8859-1" | 1145 charset="iso-8859-1" |
| 1146 From: richard <richard@test> | 1146 From: richard <richard@test.test> |
| 1147 To: issue_tracker@your.tracker.email.domain.example | 1147 To: issue_tracker@your.tracker.email.domain.example |
| 1148 Message-Id: <followup_dummy_id> | 1148 Message-Id: <followup_dummy_id> |
| 1149 In-Reply-To: <dummy_test_message_id> | 1149 In-Reply-To: <dummy_test_message_id> |
| 1150 Subject: Re: [issue1] Testing... | 1150 Subject: Re: [issue1] Testing... |
| 1151 | 1151 |
| 1194 self.db.getOTKManager().set(otk, username='johannes') | 1194 self.db.getOTKManager().set(otk, username='johannes') |
| 1195 self._handle_mail('''Content-Type: text/plain; | 1195 self._handle_mail('''Content-Type: text/plain; |
| 1196 charset="iso-8859-1" | 1196 charset="iso-8859-1" |
| 1197 From: Chef <chef@bork.bork.bork> | 1197 From: Chef <chef@bork.bork.bork> |
| 1198 To: issue_tracker@your.tracker.email.domain.example | 1198 To: issue_tracker@your.tracker.email.domain.example |
| 1199 Cc: richard@test | 1199 Cc: richard@test.test |
| 1200 Message-Id: <dummy_test_message_id> | 1200 Message-Id: <dummy_test_message_id> |
| 1201 Subject: Re: Complete your registration to Roundup issue tracker | 1201 Subject: Re: Complete your registration to Roundup issue tracker |
| 1202 -- key %s | 1202 -- key %s |
| 1203 | 1203 |
| 1204 This is a test confirmation of registration. | 1204 This is a test confirmation of registration. |
| 1207 | 1207 |
| 1208 def testFollowupOnNonIssue(self): | 1208 def testFollowupOnNonIssue(self): |
| 1209 self.db.keyword.create(name='Foo') | 1209 self.db.keyword.create(name='Foo') |
| 1210 self._handle_mail('''Content-Type: text/plain; | 1210 self._handle_mail('''Content-Type: text/plain; |
| 1211 charset="iso-8859-1" | 1211 charset="iso-8859-1" |
| 1212 From: richard <richard@test> | 1212 From: richard <richard@test.test> |
| 1213 To: issue_tracker@your.tracker.email.domain.example | 1213 To: issue_tracker@your.tracker.email.domain.example |
| 1214 Message-Id: <followup_dummy_id> | 1214 Message-Id: <followup_dummy_id> |
| 1215 In-Reply-To: <dummy_test_message_id> | 1215 In-Reply-To: <dummy_test_message_id> |
| 1216 Subject: [keyword1] Testing... [name=Bar] | 1216 Subject: [keyword1] Testing... [name=Bar] |
| 1217 | 1217 |
| 1220 | 1220 |
| 1221 def testResentFrom(self): | 1221 def testResentFrom(self): |
| 1222 nodeid = self._handle_mail('''Content-Type: text/plain; | 1222 nodeid = self._handle_mail('''Content-Type: text/plain; |
| 1223 charset="iso-8859-1" | 1223 charset="iso-8859-1" |
| 1224 From: Chef <chef@bork.bork.bork> | 1224 From: Chef <chef@bork.bork.bork> |
| 1225 Resent-From: mary <mary@test> | 1225 Resent-From: mary <mary@test.test> |
| 1226 To: issue_tracker@your.tracker.email.domain.example | 1226 To: issue_tracker@your.tracker.email.domain.example |
| 1227 Cc: richard@test | 1227 Cc: richard@test.test |
| 1228 Message-Id: <dummy_test_message_id> | 1228 Message-Id: <dummy_test_message_id> |
| 1229 Subject: [issue] Testing... | 1229 Subject: [issue] Testing... |
| 1230 | 1230 |
| 1231 This is a test submission of a new issue. | 1231 This is a test submission of a new issue. |
| 1232 ''') | 1232 ''') |
| 1241 '''Content-Type: text/plain; | 1241 '''Content-Type: text/plain; |
| 1242 charset="iso-8859-1" | 1242 charset="iso-8859-1" |
| 1243 From: Chef <chef@bork.bork.bork> | 1243 From: Chef <chef@bork.bork.bork> |
| 1244 X-Roundup-Loop: hello | 1244 X-Roundup-Loop: hello |
| 1245 To: issue_tracker@your.tracker.email.domain.example | 1245 To: issue_tracker@your.tracker.email.domain.example |
| 1246 Cc: richard@test | 1246 Cc: richard@test.test |
| 1247 Message-Id: <dummy_test_message_id> | 1247 Message-Id: <dummy_test_message_id> |
| 1248 Subject: Re: [issue] Testing... | 1248 Subject: Re: [issue] Testing... |
| 1249 | 1249 |
| 1250 Hi, I've been mis-configured to loop messages back to myself. | 1250 Hi, I've been mis-configured to loop messages back to myself. |
| 1251 ''') | 1251 ''') |
| 1255 '''Content-Type: text/plain; | 1255 '''Content-Type: text/plain; |
| 1256 charset="iso-8859-1" | 1256 charset="iso-8859-1" |
| 1257 From: Chef <chef@bork.bork.bork> | 1257 From: Chef <chef@bork.bork.bork> |
| 1258 Precedence: bulk | 1258 Precedence: bulk |
| 1259 To: issue_tracker@your.tracker.email.domain.example | 1259 To: issue_tracker@your.tracker.email.domain.example |
| 1260 Cc: richard@test | 1260 Cc: richard@test.test |
| 1261 Message-Id: <dummy_test_message_id> | 1261 Message-Id: <dummy_test_message_id> |
| 1262 Subject: Re: [issue] Testing... | 1262 Subject: Re: [issue] Testing... |
| 1263 | 1263 |
| 1264 Hi, I'm on holidays, and this is a dumb auto-responder. | 1264 Hi, I'm on holidays, and this is a dumb auto-responder. |
| 1265 ''') | 1265 ''') |
| 1268 self.assertRaises(IgnoreBulk, self._handle_mail, | 1268 self.assertRaises(IgnoreBulk, self._handle_mail, |
| 1269 '''Content-Type: text/plain; | 1269 '''Content-Type: text/plain; |
| 1270 charset="iso-8859-1" | 1270 charset="iso-8859-1" |
| 1271 From: Chef <chef@bork.bork.bork> | 1271 From: Chef <chef@bork.bork.bork> |
| 1272 To: issue_tracker@your.tracker.email.domain.example | 1272 To: issue_tracker@your.tracker.email.domain.example |
| 1273 Cc: richard@test | 1273 Cc: richard@test.test |
| 1274 Message-Id: <dummy_test_message_id> | 1274 Message-Id: <dummy_test_message_id> |
| 1275 Subject: Re: [issue] Out of office AutoReply: Back next week | 1275 Subject: Re: [issue] Out of office AutoReply: Back next week |
| 1276 | 1276 |
| 1277 Hi, I am back in the office next week | 1277 Hi, I am back in the office next week |
| 1278 ''') | 1278 ''') |
| 1281 self.assertRaises(MailUsageError, self._handle_mail, | 1281 self.assertRaises(MailUsageError, self._handle_mail, |
| 1282 '''Content-Type: text/plain; | 1282 '''Content-Type: text/plain; |
| 1283 charset="iso-8859-1" | 1283 charset="iso-8859-1" |
| 1284 From: Chef <chef@bork.bork.bork> | 1284 From: Chef <chef@bork.bork.bork> |
| 1285 To: issue_tracker@your.tracker.email.domain.example | 1285 To: issue_tracker@your.tracker.email.domain.example |
| 1286 Cc: richard@test | 1286 Cc: richard@test.test |
| 1287 Reply-To: chef@bork.bork.bork | 1287 Reply-To: chef@bork.bork.bork |
| 1288 Message-Id: <dummy_test_message_id> | 1288 Message-Id: <dummy_test_message_id> |
| 1289 | 1289 |
| 1290 ''') | 1290 ''') |
| 1291 | 1291 |
| 1297 '''Content-Type: text/plain; | 1297 '''Content-Type: text/plain; |
| 1298 charset="iso-8859-1" | 1298 charset="iso-8859-1" |
| 1299 From: Chef <chef@bork.bork.bork> | 1299 From: Chef <chef@bork.bork.bork> |
| 1300 To: issue_tracker@your.tracker.email.domain.example | 1300 To: issue_tracker@your.tracker.email.domain.example |
| 1301 Subject: [frobulated] testing | 1301 Subject: [frobulated] testing |
| 1302 Cc: richard@test | 1302 Cc: richard@test.test |
| 1303 Reply-To: chef@bork.bork.bork | 1303 Reply-To: chef@bork.bork.bork |
| 1304 Message-Id: <dummy_test_message_id> | 1304 Message-Id: <dummy_test_message_id> |
| 1305 | 1305 |
| 1306 ''') | 1306 ''') |
| 1307 self.assertRaises(MailUsageError, self._handle_mail, | 1307 self.assertRaises(MailUsageError, self._handle_mail, |
| 1308 '''Content-Type: text/plain; | 1308 '''Content-Type: text/plain; |
| 1309 charset="iso-8859-1" | 1309 charset="iso-8859-1" |
| 1310 From: Chef <chef@bork.bork.bork> | 1310 From: Chef <chef@bork.bork.bork> |
| 1311 To: issue_tracker@your.tracker.email.domain.example | 1311 To: issue_tracker@your.tracker.email.domain.example |
| 1312 Subject: [issue12345] testing | 1312 Subject: [issue12345] testing |
| 1313 Cc: richard@test | 1313 Cc: richard@test.test |
| 1314 Reply-To: chef@bork.bork.bork | 1314 Reply-To: chef@bork.bork.bork |
| 1315 Message-Id: <dummy_test_message_id> | 1315 Message-Id: <dummy_test_message_id> |
| 1316 | 1316 |
| 1317 ''') | 1317 ''') |
| 1318 | 1318 |
| 1321 nodeid = self._handle_mail('''Content-Type: text/plain; | 1321 nodeid = self._handle_mail('''Content-Type: text/plain; |
| 1322 charset="iso-8859-1" | 1322 charset="iso-8859-1" |
| 1323 From: Chef <chef@bork.bork.bork> | 1323 From: Chef <chef@bork.bork.bork> |
| 1324 To: issue_tracker@your.tracker.email.domain.example | 1324 To: issue_tracker@your.tracker.email.domain.example |
| 1325 Subject: [frobulated] testing | 1325 Subject: [frobulated] testing |
| 1326 Cc: richard@test | 1326 Cc: richard@test.test |
| 1327 Reply-To: chef@bork.bork.bork | 1327 Reply-To: chef@bork.bork.bork |
| 1328 Message-Id: <dummy_test_message_id> | 1328 Message-Id: <dummy_test_message_id> |
| 1329 | 1329 |
| 1330 ''') | 1330 ''') |
| 1331 assert not os.path.exists(SENDMAILDEBUG) | 1331 assert not os.path.exists(SENDMAILDEBUG) |
| 1337 nodeid = self._handle_mail('''Content-Type: text/plain; | 1337 nodeid = self._handle_mail('''Content-Type: text/plain; |
| 1338 charset="iso-8859-1" | 1338 charset="iso-8859-1" |
| 1339 From: Chef <chef@bork.bork.bork> | 1339 From: Chef <chef@bork.bork.bork> |
| 1340 To: issue_tracker@your.tracker.email.domain.example | 1340 To: issue_tracker@your.tracker.email.domain.example |
| 1341 Subject: Re: [frobulated] testing | 1341 Subject: Re: [frobulated] testing |
| 1342 Cc: richard@test | 1342 Cc: richard@test.test |
| 1343 Reply-To: chef@bork.bork.bork | 1343 Reply-To: chef@bork.bork.bork |
| 1344 Message-Id: <dummy_test_message_id> | 1344 Message-Id: <dummy_test_message_id> |
| 1345 | 1345 |
| 1346 ''') | 1346 ''') |
| 1347 assert not os.path.exists(SENDMAILDEBUG) | 1347 assert not os.path.exists(SENDMAILDEBUG) |
| 1353 nodeid = self._handle_mail('''Content-Type: text/plain; | 1353 nodeid = self._handle_mail('''Content-Type: text/plain; |
| 1354 charset="iso-8859-1" | 1354 charset="iso-8859-1" |
| 1355 From: Chef <chef@bork.bork.bork> | 1355 From: Chef <chef@bork.bork.bork> |
| 1356 To: issue_tracker@your.tracker.email.domain.example | 1356 To: issue_tracker@your.tracker.email.domain.example |
| 1357 Subject: [issue1234] testing | 1357 Subject: [issue1234] testing |
| 1358 Cc: richard@test | 1358 Cc: richard@test.test |
| 1359 Reply-To: chef@bork.bork.bork | 1359 Reply-To: chef@bork.bork.bork |
| 1360 Message-Id: <dummy_test_message_id> | 1360 Message-Id: <dummy_test_message_id> |
| 1361 | 1361 |
| 1362 ''') | 1362 ''') |
| 1363 assert not os.path.exists(SENDMAILDEBUG) | 1363 assert not os.path.exists(SENDMAILDEBUG) |
| 1370 nodeid = self._handle_mail('''Content-Type: text/plain; | 1370 nodeid = self._handle_mail('''Content-Type: text/plain; |
| 1371 charset="iso-8859-1" | 1371 charset="iso-8859-1" |
| 1372 From: Chef <chef@bork.bork.bork> | 1372 From: Chef <chef@bork.bork.bork> |
| 1373 To: issue_tracker@your.tracker.email.domain.example | 1373 To: issue_tracker@your.tracker.email.domain.example |
| 1374 Subject: [keyword1] Testing... [name=Bar] | 1374 Subject: [keyword1] Testing... [name=Bar] |
| 1375 Cc: richard@test | 1375 Cc: richard@test.test |
| 1376 Reply-To: chef@bork.bork.bork | 1376 Reply-To: chef@bork.bork.bork |
| 1377 Message-Id: <dummy_test_message_id> | 1377 Message-Id: <dummy_test_message_id> |
| 1378 | 1378 |
| 1379 ''') | 1379 ''') |
| 1380 assert not os.path.exists(SENDMAILDEBUG) | 1380 assert not os.path.exists(SENDMAILDEBUG) |
| 1386 | 1386 |
| 1387 message = '''Content-Type: text/plain; | 1387 message = '''Content-Type: text/plain; |
| 1388 charset="iso-8859-1" | 1388 charset="iso-8859-1" |
| 1389 From: Chef <chef@bork.bork.bork> | 1389 From: Chef <chef@bork.bork.bork> |
| 1390 To: issue_tracker@your.tracker.email.domain.example | 1390 To: issue_tracker@your.tracker.email.domain.example |
| 1391 Subject: Testing... | 1391 Subject: Testing... |
| 1392 Cc: richard@test | 1392 Cc: richard@test.test |
| 1393 Reply-To: chef@bork.bork.bork | 1393 Reply-To: chef@bork.bork.bork |
| 1394 Message-Id: <dummy_test_message_id> | 1394 Message-Id: <dummy_test_message_id> |
| 1395 | 1395 |
| 1396 ''' | 1396 ''' |
| 1397 self.assertRaises(MailUsageError, self._handle_mail, message) | 1397 self.assertRaises(MailUsageError, self._handle_mail, message) |
| 1398 | 1398 |
| 1399 def testClassStrictValid(self): | 1399 def testClassStrictValid(self): |
| 1400 self.instance.config.MAILGW_SUBJECT_PREFIX_PARSING = 'strict' | 1400 self.instance.config.MAILGW_SUBJECT_PREFIX_PARSING = 'strict' |
| 1401 self.instance.config.MAILGW_DEFAULT_CLASS = '' | 1401 self.instance.config.MAILGW_DEFAULT_CLASS = '' |
| 1402 | 1402 |
| 1403 nodeid = self._handle_mail('''Content-Type: text/plain; | 1403 nodeid = self._handle_mail('''Content-Type: text/plain; |
| 1404 charset="iso-8859-1" | 1404 charset="iso-8859-1" |
| 1405 From: Chef <chef@bork.bork.bork> | 1405 From: Chef <chef@bork.bork.bork> |
| 1406 To: issue_tracker@your.tracker.email.domain.example | 1406 To: issue_tracker@your.tracker.email.domain.example |
| 1407 Subject: [issue] Testing... | 1407 Subject: [issue] Testing... |
| 1408 Cc: richard@test | 1408 Cc: richard@test.test |
| 1409 Reply-To: chef@bork.bork.bork | 1409 Reply-To: chef@bork.bork.bork |
| 1410 Message-Id: <dummy_test_message_id> | 1410 Message-Id: <dummy_test_message_id> |
| 1411 | 1411 |
| 1412 ''') | 1412 ''') |
| 1413 | 1413 |
| 1414 assert not os.path.exists(SENDMAILDEBUG) | 1414 assert not os.path.exists(SENDMAILDEBUG) |
| 1415 self.assertEqual(self.db.issue.get(nodeid, 'title'), 'Testing...') | 1415 self.assertEqual(self.db.issue.get(nodeid, 'title'), 'Testing...') |
| 1416 | 1416 |
| 1417 # | 1417 # |
| 1418 # TEST FOR INVALID COMMANDS HANDLING | 1418 # TEST FOR INVALID COMMANDS HANDLING |
| 1419 # | 1419 # |
| 1420 def testInvalidCommands(self): | 1420 def testInvalidCommands(self): |
| 1421 self.assertRaises(MailUsageError, self._handle_mail, | 1421 self.assertRaises(MailUsageError, self._handle_mail, |
| 1422 '''Content-Type: text/plain; | 1422 '''Content-Type: text/plain; |
| 1423 charset="iso-8859-1" | 1423 charset="iso-8859-1" |
| 1424 From: Chef <chef@bork.bork.bork> | 1424 From: Chef <chef@bork.bork.bork> |
| 1425 To: issue_tracker@your.tracker.email.domain.example | 1425 To: issue_tracker@your.tracker.email.domain.example |
| 1426 Subject: testing [frobulated] | 1426 Subject: testing [frobulated] |
| 1427 Cc: richard@test | 1427 Cc: richard@test.test |
| 1428 Reply-To: chef@bork.bork.bork | 1428 Reply-To: chef@bork.bork.bork |
| 1429 Message-Id: <dummy_test_message_id> | 1429 Message-Id: <dummy_test_message_id> |
| 1430 | 1430 |
| 1431 ''') | 1431 ''') |
| 1432 | 1432 |
| 1435 nodeid = self._handle_mail('''Content-Type: text/plain; | 1435 nodeid = self._handle_mail('''Content-Type: text/plain; |
| 1436 charset="iso-8859-1" | 1436 charset="iso-8859-1" |
| 1437 From: Chef <chef@bork.bork.bork> | 1437 From: Chef <chef@bork.bork.bork> |
| 1438 To: issue_tracker@your.tracker.email.domain.example | 1438 To: issue_tracker@your.tracker.email.domain.example |
| 1439 Subject: testing [frobulated] | 1439 Subject: testing [frobulated] |
| 1440 Cc: richard@test | 1440 Cc: richard@test.test |
| 1441 Reply-To: chef@bork.bork.bork | 1441 Reply-To: chef@bork.bork.bork |
| 1442 Message-Id: <dummy_test_message_id> | 1442 Message-Id: <dummy_test_message_id> |
| 1443 | 1443 |
| 1444 ''') | 1444 ''') |
| 1445 assert not os.path.exists(SENDMAILDEBUG) | 1445 assert not os.path.exists(SENDMAILDEBUG) |
| 1451 nodeid = self._handle_mail('''Content-Type: text/plain; | 1451 nodeid = self._handle_mail('''Content-Type: text/plain; |
| 1452 charset="iso-8859-1" | 1452 charset="iso-8859-1" |
| 1453 From: Chef <chef@bork.bork.bork> | 1453 From: Chef <chef@bork.bork.bork> |
| 1454 To: issue_tracker@your.tracker.email.domain.example | 1454 To: issue_tracker@your.tracker.email.domain.example |
| 1455 Subject: testing [frobulated] | 1455 Subject: testing [frobulated] |
| 1456 Cc: richard@test | 1456 Cc: richard@test.test |
| 1457 Reply-To: chef@bork.bork.bork | 1457 Reply-To: chef@bork.bork.bork |
| 1458 Message-Id: <dummy_test_message_id> | 1458 Message-Id: <dummy_test_message_id> |
| 1459 | 1459 |
| 1460 ''') | 1460 ''') |
| 1461 assert not os.path.exists(SENDMAILDEBUG) | 1461 assert not os.path.exists(SENDMAILDEBUG) |
| 1467 nodeid = self._handle_mail('''Content-Type: text/plain; | 1467 nodeid = self._handle_mail('''Content-Type: text/plain; |
| 1468 charset="iso-8859-1" | 1468 charset="iso-8859-1" |
| 1469 From: Chef <chef@bork.bork.bork> | 1469 From: Chef <chef@bork.bork.bork> |
| 1470 To: issue_tracker@your.tracker.email.domain.example | 1470 To: issue_tracker@your.tracker.email.domain.example |
| 1471 Subject: testing [assignedto=mary] | 1471 Subject: testing [assignedto=mary] |
| 1472 Cc: richard@test | 1472 Cc: richard@test.test |
| 1473 Reply-To: chef@bork.bork.bork | 1473 Reply-To: chef@bork.bork.bork |
| 1474 Message-Id: <dummy_test_message_id> | 1474 Message-Id: <dummy_test_message_id> |
| 1475 | 1475 |
| 1476 ''') | 1476 ''') |
| 1477 assert not os.path.exists(SENDMAILDEBUG) | 1477 assert not os.path.exists(SENDMAILDEBUG) |
| 1483 nodeid = self._handle_mail('''Content-Type: text/plain; | 1483 nodeid = self._handle_mail('''Content-Type: text/plain; |
| 1484 charset="iso-8859-1" | 1484 charset="iso-8859-1" |
| 1485 From: Chef <chef@bork.bork.bork> | 1485 From: Chef <chef@bork.bork.bork> |
| 1486 To: issue_tracker@your.tracker.email.domain.example | 1486 To: issue_tracker@your.tracker.email.domain.example |
| 1487 Subject: testing {assignedto=mary} | 1487 Subject: testing {assignedto=mary} |
| 1488 Cc: richard@test | 1488 Cc: richard@test.test |
| 1489 Reply-To: chef@bork.bork.bork | 1489 Reply-To: chef@bork.bork.bork |
| 1490 Message-Id: <dummy_test_message_id> | 1490 Message-Id: <dummy_test_message_id> |
| 1491 | 1491 |
| 1492 ''') | 1492 ''') |
| 1493 assert not os.path.exists(SENDMAILDEBUG) | 1493 assert not os.path.exists(SENDMAILDEBUG) |
| 1497 def testPrefixDelimiters(self): | 1497 def testPrefixDelimiters(self): |
| 1498 self.instance.config.MAILGW_SUBJECT_SUFFIX_DELIMITERS = '{}' | 1498 self.instance.config.MAILGW_SUBJECT_SUFFIX_DELIMITERS = '{}' |
| 1499 self.db.keyword.create(name='Foo') | 1499 self.db.keyword.create(name='Foo') |
| 1500 self._handle_mail('''Content-Type: text/plain; | 1500 self._handle_mail('''Content-Type: text/plain; |
| 1501 charset="iso-8859-1" | 1501 charset="iso-8859-1" |
| 1502 From: richard <richard@test> | 1502 From: richard <richard@test.test> |
| 1503 To: issue_tracker@your.tracker.email.domain.example | 1503 To: issue_tracker@your.tracker.email.domain.example |
| 1504 Message-Id: <followup_dummy_id> | 1504 Message-Id: <followup_dummy_id> |
| 1505 In-Reply-To: <dummy_test_message_id> | 1505 In-Reply-To: <dummy_test_message_id> |
| 1506 Subject: {keyword1} Testing... {name=Bar} | 1506 Subject: {keyword1} Testing... {name=Bar} |
| 1507 | 1507 |
| 1514 nodeid = self._handle_mail('''Content-Type: text/plain; | 1514 nodeid = self._handle_mail('''Content-Type: text/plain; |
| 1515 charset="iso-8859-1" | 1515 charset="iso-8859-1" |
| 1516 From: Chef <chef@bork.bork.bork> | 1516 From: Chef <chef@bork.bork.bork> |
| 1517 To: issue_tracker@your.tracker.email.domain.example | 1517 To: issue_tracker@your.tracker.email.domain.example |
| 1518 Subject: testing [assignedto=mary] | 1518 Subject: testing [assignedto=mary] |
| 1519 Cc: richard@test | 1519 Cc: richard@test.test |
| 1520 Reply-To: chef@bork.bork.bork | 1520 Reply-To: chef@bork.bork.bork |
| 1521 Message-Id: <dummy_test_message_id> | 1521 Message-Id: <dummy_test_message_id> |
| 1522 | 1522 |
| 1523 ''') | 1523 ''') |
| 1524 assert not os.path.exists(SENDMAILDEBUG) | 1524 assert not os.path.exists(SENDMAILDEBUG) |
| 1547 Message-Id: <dummy_test_message_id3> | 1547 Message-Id: <dummy_test_message_id3> |
| 1548 In-Reply-To: <dummy_test_message_id2> | 1548 In-Reply-To: <dummy_test_message_id2> |
| 1549 Subject: Testing... | 1549 Subject: Testing... |
| 1550 | 1550 |
| 1551 Yet another message in the same thread/issue. | 1551 Yet another message in the same thread/issue. |
| 1552 ''') | 1552 ''') |
| 1553 | 1553 |
| 1554 self.assertEqual(nodeid, nodeid2) | 1554 self.assertEqual(nodeid, nodeid2) |
| 1555 self.assertEqual(nodeid, nodeid3) | 1555 self.assertEqual(nodeid, nodeid3) |
| 1556 | 1556 |
| 1557 def testHelpSubject(self): | 1557 def testHelpSubject(self): |
| 1567 ''' | 1567 ''' |
| 1568 self.assertRaises(MailUsageHelp, self._handle_mail, message) | 1568 self.assertRaises(MailUsageHelp, self._handle_mail, message) |
| 1569 | 1569 |
| 1570 def testMaillistSubject(self): | 1570 def testMaillistSubject(self): |
| 1571 self.instance.config.MAILGW_SUBJECT_SUFFIX_DELIMITERS = '[]' | 1571 self.instance.config.MAILGW_SUBJECT_SUFFIX_DELIMITERS = '[]' |
| 1572 self.db.keyword.create(name='Foo') | 1572 self.db.keyword.create(name='Foo') |
| 1573 self._handle_mail('''Content-Type: text/plain; | 1573 self._handle_mail('''Content-Type: text/plain; |
| 1574 charset="iso-8859-1" | 1574 charset="iso-8859-1" |
| 1575 From: Chef <chef@bork.bork.bork> | 1575 From: Chef <chef@bork.bork.bork> |
| 1576 To: issue_tracker@your.tracker.email.domain.example | 1576 To: issue_tracker@your.tracker.email.domain.example |
| 1577 Subject: [mailinglist-name] [keyword1] Testing.. [name=Bar] | 1577 Subject: [mailinglist-name] [keyword1] Testing.. [name=Bar] |
| 1578 Cc: richard@test | 1578 Cc: richard@test.test |
| 1579 Reply-To: chef@bork.bork.bork | 1579 Reply-To: chef@bork.bork.bork |
| 1580 Message-Id: <dummy_test_message_id> | 1580 Message-Id: <dummy_test_message_id> |
| 1581 | 1581 |
| 1582 ''') | 1582 ''') |
| 1583 | 1583 |
| 1589 self._handle_mail('''Content-Type: text/plain; | 1589 self._handle_mail('''Content-Type: text/plain; |
| 1590 charset="iso-8859-1" | 1590 charset="iso-8859-1" |
| 1591 From: Chef <chef@bork.bork.bork> | 1591 From: Chef <chef@bork.bork.bork> |
| 1592 To: issue_tracker@your.tracker.email.domain.example | 1592 To: issue_tracker@your.tracker.email.domain.example |
| 1593 Subject: VeryStrangeRe: [keyword1] Testing.. [name=Bar] | 1593 Subject: VeryStrangeRe: [keyword1] Testing.. [name=Bar] |
| 1594 Cc: richard@test | 1594 Cc: richard@test.test |
| 1595 Reply-To: chef@bork.bork.bork | 1595 Reply-To: chef@bork.bork.bork |
| 1596 Message-Id: <dummy_test_message_id> | 1596 Message-Id: <dummy_test_message_id> |
| 1597 | 1597 |
| 1598 ''') | 1598 ''') |
| 1599 | 1599 |
| 1602 | 1602 |
| 1603 def testIssueidLast(self): | 1603 def testIssueidLast(self): |
| 1604 nodeid1 = self.doNewIssue() | 1604 nodeid1 = self.doNewIssue() |
| 1605 nodeid2 = self._handle_mail('''Content-Type: text/plain; | 1605 nodeid2 = self._handle_mail('''Content-Type: text/plain; |
| 1606 charset="iso-8859-1" | 1606 charset="iso-8859-1" |
| 1607 From: mary <mary@test> | 1607 From: mary <mary@test.test> |
| 1608 To: issue_tracker@your.tracker.email.domain.example | 1608 To: issue_tracker@your.tracker.email.domain.example |
| 1609 Message-Id: <followup_dummy_id> | 1609 Message-Id: <followup_dummy_id> |
| 1610 In-Reply-To: <dummy_test_message_id> | 1610 In-Reply-To: <dummy_test_message_id> |
| 1611 Subject: New title [issue1] | 1611 Subject: New title [issue1] |
| 1612 | 1612 |
| 1613 This is a second followup | 1613 This is a second followup |
| 1614 ''') | 1614 ''') |
| 1615 | 1615 |
| 1616 assert nodeid1 == nodeid2 | 1616 assert nodeid1 == nodeid2 |
| 1617 self.assertEqual(self.db.issue.get(nodeid2, 'title'), "Testing...") | 1617 self.assertEqual(self.db.issue.get(nodeid2, 'title'), "Testing...") |
| 1618 | 1618 |
| 1619 | 1619 |
| 1620 def test_suite(): | 1620 def test_suite(): |
| 1621 suite = unittest.TestSuite() | 1621 suite = unittest.TestSuite() |
| 1622 suite.addTest(unittest.makeSuite(MailgwTestCase)) | 1622 suite.addTest(unittest.makeSuite(MailgwTestCase)) |
| 1623 return suite | 1623 return suite |
