diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-11-25 22:16:18 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-11-25 22:16:18 +0100 |
commit | 56dc1c9d3eb73b86bf8e165ffc79ad4929239603 (patch) | |
tree | a57858274c126acc71fededf7a8c6663d4a05619 /mediagoblin/tests/tools.py | |
parent | 1b7662012f4f0827d01cc8747ce710b3e4dc6b81 (diff) | |
download | mediagoblin-56dc1c9d3eb73b86bf8e165ffc79ad4929239603.tar.lz mediagoblin-56dc1c9d3eb73b86bf8e165ffc79ad4929239603.tar.xz mediagoblin-56dc1c9d3eb73b86bf8e165ffc79ad4929239603.zip |
Add base class for Meddleware
Created a BaseMeddleware which all Meddleware should derive
from. This is not strictly needed, but will greatly help.
The base class has the common __init__ of all the other
Meddlwares and fall backs for all hooks. That way a new
Meddlware only needs to override what it actually wants to
implement.
Diffstat (limited to 'mediagoblin/tests/tools.py')
-rw-r--r-- | mediagoblin/tests/tools.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/mediagoblin/tests/tools.py b/mediagoblin/tests/tools.py index 1a26c6e9..01813e96 100644 --- a/mediagoblin/tests/tools.py +++ b/mediagoblin/tests/tools.py @@ -26,6 +26,7 @@ from mediagoblin.tools import testing from mediagoblin.init.config import read_mediagoblin_config from mediagoblin.decorators import _make_safe from mediagoblin.db.open import setup_connection_and_db_from_config +from mediagoblin.meddleware import BaseMeddleware MEDIAGOBLIN_TEST_DB_NAME = u'__mediagoblin_tests__' @@ -50,7 +51,7 @@ $ CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_tests ./bin/nosetests""" class BadCeleryEnviron(Exception): pass -class TestingMeddleware(object): +class TestingMeddleware(BaseMeddleware): """ Meddleware for the Unit tests @@ -69,12 +70,6 @@ class TestingMeddleware(object): create a new method and call it from process_*. """ - def __init__(self, mg_app): - self.app = mg_app - - def process_request(self, request): - pass - def process_response(self, request, response): # All following tests should be for html only! if response.content_type != "text/html": |