# HG changeset patch # User mgood # Date 1237766880 0 # Node ID 1f29360d8fd0e50f7297c767844df27376c7e9b4 # Parent 6a2dc6cdc4dd6389027bb69b799311b45ea2137f Make notification tests enable the components instead of monkey-patching `env.get_templates_dir` diff --git a/bitten/tests/notify.py b/bitten/tests/notify.py --- a/bitten/tests/notify.py +++ b/bitten/tests/notify.py @@ -16,15 +16,13 @@ from bitten.model import * from bitten.notify import * -ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) class BittenNotifyBaseTest(unittest.TestCase): def setUp(self): self.set_up_env() def set_up_env(self): - self.env = EnvironmentStub() - self.env.get_templates_dir = lambda *args: os.path.join(ROOT, 'bitten', 'templates') + self.env = EnvironmentStub(enable=['trac.*', 'bitten.notify.*']) self.env.path = '' self.repos = Mock(get_changeset=lambda rev: Mock(author = 'author')) self.env.get_repository = lambda authname = None: self.repos @@ -37,6 +35,7 @@ cursor.execute(stmt) db.commit() + class BittenNotifyTest(BittenNotifyBaseTest): """unit tests for BittenNotify dispatcher class""" def setUp(self):