comparison test/test_mailgw.py @ 1085:04a6b3bfbf23

instance_config -> config, and other related cleanups
author Richard Jones <richard@users.sourceforge.net>
date Mon, 09 Sep 2002 23:55:29 +0000
parents a8d80ffe37cc
children 9b910e8d987d
comparison
equal deleted inserted replaced
1084:a625adcd6254 1085:04a6b3bfbf23
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.25 2002-07-29 00:56:06 richard Exp $ 11 # $Id: test_mailgw.py,v 1.26 2002-09-09 23:55:29 richard Exp $
12 12
13 import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib 13 import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib
14 14
15 # Note: Should parse emails according to RFC2822 instead of performing a 15 # Note: Should parse emails according to RFC2822 instead of performing a
16 # literal string comparision. Parsing the messages allows the tests to work for 16 # literal string comparision. Parsing the messages allows the tests to work for
117 117
118 def testNewIssue(self): 118 def testNewIssue(self):
119 self.doNewIssue() 119 self.doNewIssue()
120 120
121 def testNewIssueNosy(self): 121 def testNewIssueNosy(self):
122 self.instance.ADD_AUTHOR_TO_NOSY = 'yes' 122 self.instance.config.ADD_AUTHOR_TO_NOSY = 'yes'
123 message = cStringIO.StringIO('''Content-Type: text/plain; 123 message = cStringIO.StringIO('''Content-Type: text/plain;
124 charset="iso-8859-1" 124 charset="iso-8859-1"
125 From: Chef <chef@bork.bork.bork> 125 From: Chef <chef@bork.bork.bork>
126 To: issue_tracker@your.tracker.email.domain.example 126 To: issue_tracker@your.tracker.email.domain.example
127 Cc: richard@test 127 Cc: richard@test
373 _________________________________________________________________________ 373 _________________________________________________________________________
374 ''') 374 ''')
375 375
376 def testFollowupNosyAuthor(self): 376 def testFollowupNosyAuthor(self):
377 self.doNewIssue() 377 self.doNewIssue()
378 self.db.config.ADD_AUTHOR_TO_NOSY = self.instance.ADD_AUTHOR_TO_NOSY = 'yes' 378 self.db.config.ADD_AUTHOR_TO_NOSY = 'yes'
379 message = cStringIO.StringIO('''Content-Type: text/plain; 379 message = cStringIO.StringIO('''Content-Type: text/plain;
380 charset="iso-8859-1" 380 charset="iso-8859-1"
381 From: john@test 381 From: john@test
382 To: issue_tracker@your.tracker.email.domain.example 382 To: issue_tracker@your.tracker.email.domain.example
383 Message-Id: <followup_dummy_id> 383 Message-Id: <followup_dummy_id>
420 420
421 ''') 421 ''')
422 422
423 def testFollowupNosyRecipients(self): 423 def testFollowupNosyRecipients(self):
424 self.doNewIssue() 424 self.doNewIssue()
425 self.db.config.ADD_RECIPIENTS_TO_NOSY = self.instance.ADD_RECIPIENTS_TO_NOSY = 'yes' 425 self.db.config.ADD_RECIPIENTS_TO_NOSY = 'yes'
426 message = cStringIO.StringIO('''Content-Type: text/plain; 426 message = cStringIO.StringIO('''Content-Type: text/plain;
427 charset="iso-8859-1" 427 charset="iso-8859-1"
428 From: richard@test 428 From: richard@test
429 To: issue_tracker@your.tracker.email.domain.example 429 To: issue_tracker@your.tracker.email.domain.example
430 Cc: john@test 430 Cc: john@test
468 468
469 ''') 469 ''')
470 470
471 def testFollowupNosyAuthorAndCopy(self): 471 def testFollowupNosyAuthorAndCopy(self):
472 self.doNewIssue() 472 self.doNewIssue()
473 self.db.config.ADD_AUTHOR_TO_NOSY = self.instance.ADD_AUTHOR_TO_NOSY = 'yes' 473 self.db.config.ADD_AUTHOR_TO_NOSY = 'yes'
474 self.db.config.MESSAGES_TO_AUTHOR = 'yes' 474 self.db.config.MESSAGES_TO_AUTHOR = 'yes'
475 message = cStringIO.StringIO('''Content-Type: text/plain; 475 message = cStringIO.StringIO('''Content-Type: text/plain;
476 charset="iso-8859-1" 476 charset="iso-8859-1"
477 From: john@test 477 From: john@test
478 To: issue_tracker@your.tracker.email.domain.example 478 To: issue_tracker@your.tracker.email.domain.example
516 516
517 ''') 517 ''')
518 518
519 def testFollowupNoNosyAuthor(self): 519 def testFollowupNoNosyAuthor(self):
520 self.doNewIssue() 520 self.doNewIssue()
521 self.instance.ADD_AUTHOR_TO_NOSY = 'no' 521 self.instance.config.ADD_AUTHOR_TO_NOSY = 'no'
522 message = cStringIO.StringIO('''Content-Type: text/plain; 522 message = cStringIO.StringIO('''Content-Type: text/plain;
523 charset="iso-8859-1" 523 charset="iso-8859-1"
524 From: john@test 524 From: john@test
525 To: issue_tracker@your.tracker.email.domain.example 525 To: issue_tracker@your.tracker.email.domain.example
526 Message-Id: <followup_dummy_id> 526 Message-Id: <followup_dummy_id>
562 562
563 ''') 563 ''')
564 564
565 def testFollowupNoNosyRecipients(self): 565 def testFollowupNoNosyRecipients(self):
566 self.doNewIssue() 566 self.doNewIssue()
567 self.instance.ADD_RECIPIENTS_TO_NOSY = 'no' 567 self.instance.config.ADD_RECIPIENTS_TO_NOSY = 'no'
568 message = cStringIO.StringIO('''Content-Type: text/plain; 568 message = cStringIO.StringIO('''Content-Type: text/plain;
569 charset="iso-8859-1" 569 charset="iso-8859-1"
570 From: richard@test 570 From: richard@test
571 To: issue_tracker@your.tracker.email.domain.example 571 To: issue_tracker@your.tracker.email.domain.example
572 Cc: john@test 572 Cc: john@test
779 return unittest.TestSuite(l) 779 return unittest.TestSuite(l)
780 780
781 781
782 # 782 #
783 # $Log: not supported by cvs2svn $ 783 # $Log: not supported by cvs2svn $
784 # Revision 1.25 2002/07/29 00:56:06 richard
785 # Removed the unnecessary volatiledb and the related complications. Security
786 # much simpler and self-contained now.
787 #
784 # Revision 1.24 2002/07/26 08:27:00 richard 788 # Revision 1.24 2002/07/26 08:27:00 richard
785 # Very close now. The cgi and mailgw now use the new security API. The two 789 # Very close now. The cgi and mailgw now use the new security API. The two
786 # templates have been migrated to that setup. Lots of unit tests. Still some 790 # templates have been migrated to that setup. Lots of unit tests. Still some
787 # issue in the web form for editing Roles assigned to users. 791 # issue in the web form for editing Roles assigned to users.
788 # 792 #

Roundup Issue Tracker: http://roundup-tracker.org/