Mercurial > p > roundup > code
comparison test/test_mailgw.py @ 524:dce4c75bef5a
changed all config accesses...
...so they access either the instance or the config attriubute on the
db. This means that all config is obtained from instance_config
instead of the mish-mash of classes. This will make switching to a
ConfigParser setup easier too, I hope.
At a minimum, this makes migration a _little_ easier (a lot easier in the
0.5.0 switch, I hope!)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 14 Jan 2002 02:20:15 +0000 |
| parents | f2edf460b0b9 |
| children | a69dc91643e9 |
comparison
equal
deleted
inserted
replaced
| 523:32db08940334 | 524:dce4c75bef5a |
|---|---|
| 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.2 2002-01-11 23:22:29 richard Exp $ | 11 # $Id: test_mailgw.py,v 1.3 2002-01-14 02:20:15 richard Exp $ |
| 12 | 12 |
| 13 import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys | 13 import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys |
| 14 | 14 |
| 15 from roundup.mailgw import MailGW | 15 from roundup.mailgw import MailGW |
| 16 from roundup import init, instance | 16 from roundup import init, instance |
| 71 | 71 |
| 72 This is a test submission of a new issue. | 72 This is a test submission of a new issue. |
| 73 ''') | 73 ''') |
| 74 handler = self.instance.MailGW(self.instance, self.db) | 74 handler = self.instance.MailGW(self.instance, self.db) |
| 75 # TODO: fix the damn config - this is apalling | 75 # TODO: fix the damn config - this is apalling |
| 76 self.instance.IssueClass.MESSAGES_TO_AUTHOR = 'yes' | 76 self.db.config.MESSAGES_TO_AUTHOR = 'yes' |
| 77 handler.main(message) | 77 handler.main(message) |
| 78 | 78 |
| 79 self.assertEqual(open(os.environ['SENDMAILDEBUG']).read(), | 79 self.assertEqual(open(os.environ['SENDMAILDEBUG']).read(), |
| 80 '''FROM: roundup-admin@fill.me.in. | 80 '''FROM: roundup-admin@fill.me.in. |
| 81 TO: chef@bork.bork.bork | 81 TO: chef@bork.bork.bork |
| 186 return unittest.TestSuite(l) | 186 return unittest.TestSuite(l) |
| 187 | 187 |
| 188 | 188 |
| 189 # | 189 # |
| 190 # $Log: not supported by cvs2svn $ | 190 # $Log: not supported by cvs2svn $ |
| 191 # Revision 1.2 2002/01/11 23:22:29 richard | |
| 192 # . #502437 ] rogue reactor and unittest | |
| 193 # in short, the nosy reactor was modifying the nosy list. That code had | |
| 194 # been there for a long time, and I suspsect it was there because we | |
| 195 # weren't generating the nosy list correctly in other places of the code. | |
| 196 # We're now doing that, so the nosy-modifying code can go away from the | |
| 197 # nosy reactor. | |
| 198 # | |
| 191 # Revision 1.1 2002/01/02 02:31:38 richard | 199 # Revision 1.1 2002/01/02 02:31:38 richard |
| 192 # Sorry for the huge checkin message - I was only intending to implement #496356 | 200 # Sorry for the huge checkin message - I was only intending to implement #496356 |
| 193 # but I found a number of places where things had been broken by transactions: | 201 # but I found a number of places where things had been broken by transactions: |
| 194 # . modified ROUNDUPDBSENDMAILDEBUG to be SENDMAILDEBUG and hold a filename | 202 # . modified ROUNDUPDBSENDMAILDEBUG to be SENDMAILDEBUG and hold a filename |
| 195 # for _all_ roundup-generated smtp messages to be sent to. | 203 # for _all_ roundup-generated smtp messages to be sent to. |
