Mercurial > p > roundup > code
view test/test_memorydb.py @ 5098:99e289359798
issue2550803: Replying to NOSY mail goes to the tracker through
reply-to, not original message author.
Created new [tracker] replyto_address config.ini option to allow:
1) setting reply-to header to the tracker
2) setting reply-to header to the address of the author
of the change
3) setting it to a fixed address (like noreply@some.place)
Proposal by Peter Funk (pefu) in discussion with Tom Ekberg
(tekberg).
I chose to re-retrieve the email address for the author from the
database rather than adding a new variable. Also managed to make
a test case for each of the three settings.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 26 Jun 2016 00:36:23 -0400 |
| parents | 364c54991861 |
| children | 62de601bdf6f |
line wrap: on
line source
import unittest, os, shutil, time from roundup import hyperdb from db_test_base import DBTest, ROTest, SchemaTest, config, setupSchema import memorydb class memorydbOpener: module = memorydb def nuke_database(self): # really kill it self.db = None db = None def open_database(self): if self.db is None: self.db = self.module.Database(config, 'admin') return self.db def setUp(self): self.open_database() setupSchema(self.db, 1, self.module) def tearDown(self): if self.db is not None: self.db.close() # nuke and re-create db for restore def nukeAndCreate(self): self.db.close() self.nuke_database() self.db = self.module.Database(config, 'admin') setupSchema(self.db, 0, self.module) class memorydbDBTest(memorydbOpener, DBTest, unittest.TestCase): pass class memorydbROTest(memorydbOpener, ROTest, unittest.TestCase): def setUp(self): self.db = self.module.Database(config) setupSchema(self.db, 0, self.module) class memorydbSchemaTest(memorydbOpener, SchemaTest, unittest.TestCase): pass from session_common import DBMTest class memorydbSessionTest(memorydbOpener, DBMTest, unittest.TestCase): def setUp(self): self.db = self.module.Database(config, 'admin') setupSchema(self.db, 1, self.module) self.sessions = self.db.sessions # vim: set filetype=python ts=4 sw=4 et si
