Mercurial > hg > ltpdarepo
changeset 86:5c567edc0e6c
Set TESTING=True in tests and development server.
Avoid that the mailer utility tries to send emails during testing.
author | Daniele Nicolodi <daniele@grinta.net> |
---|---|
date | Sun, 21 Aug 2011 18:17:12 +0200 |
parents | ff2da2018071 |
children | 6a52c9c3d5ff |
files | src/ltpdarepo/__init__.py src/ltpdarepo/tests/utils.py |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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()
--- 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()