# HG changeset patch # User Daniele Nicolodi # Date 1313943432 -7200 # Node ID 5c567edc0e6c16d44ef117eaec3d59c761b873b7 # Parent ff2da2018071b6673d9a4a21810a7bb364dadb93 Set TESTING=True in tests and development server. Avoid that the mailer utility tries to send emails during testing. diff -r ff2da2018071 -r 5c567edc0e6c src/ltpdarepo/__init__.py --- a/src/ltpdarepo/__init__.py Sun Aug 21 16:10:23 2011 +0200 +++ b/src/ltpdarepo/__init__.py Sun Aug 21 18:17:12 2011 +0200 @@ -140,4 +140,6 @@ def main(): app.config.from_pyfile('config.py') - app.run(debug=True) + app.config['TESTING'] = True + app.config['DEBUG'] = True + app.run() diff -r ff2da2018071 -r 5c567edc0e6c src/ltpdarepo/tests/utils.py --- a/src/ltpdarepo/tests/utils.py Sun Aug 21 16:10:23 2011 +0200 +++ b/src/ltpdarepo/tests/utils.py Sun Aug 21 18:17:12 2011 +0200 @@ -1,11 +1,14 @@ import unittest2 as unittest import zope.testbrowser.wsgi + class RequestContextTestCase(unittest.TestCase): def setUp(self): # application from ltpdarepo import app + app.config.from_pyfile('config.py') + app.config['TESTING'] = True self.app = app # fake request self.ctx = self.app.test_request_context() @@ -24,6 +27,7 @@ from ltpdarepo import app app.config.from_pyfile('config.py') + app.config['TESTING'] = True import logging handler = logging.StreamHandler()