aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2013-05-08 14:35:31 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2013-05-08 14:35:31 -0500
commit3810309443899e92d640fb0c893018ef82b786ee (patch)
treef877df48ffde7049320122292f68fe3608481e26 /mediagoblin/tests
parentf65bf8983611b18ec3a6a042404c50b8558529df (diff)
downloadmediagoblin-3810309443899e92d640fb0c893018ef82b786ee.tar.lz
mediagoblin-3810309443899e92d640fb0c893018ef82b786ee.tar.xz
mediagoblin-3810309443899e92d640fb0c893018ef82b786ee.zip
The beginning of context hooks.
Not the working solution, but getting there conceptually. Basically we'll have a key with the view and the template as a tuple which is the context hook that anyone can attach to. However, some changes have still to be made: - The unit test doesn't work yet and contains a set_trace ;) - We'll probably switch the "view" component from being the callable to the "urlgen"'able name per Elrond's suggestion - Found a bug in unit tests related to running custom apps for different configs... hm. I need to fix this! Nonetheless, making progress. This commit sponsored by... wait a minute... Christopher Webber?!
Diffstat (limited to 'mediagoblin/tests')
-rw-r--r--mediagoblin/tests/test_pluginapi.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/mediagoblin/tests/test_pluginapi.py b/mediagoblin/tests/test_pluginapi.py
index 809b5ce9..308151a7 100644
--- a/mediagoblin/tests/test_pluginapi.py
+++ b/mediagoblin/tests/test_pluginapi.py
@@ -25,6 +25,7 @@ from mediagoblin import mg_globals
from mediagoblin.init.plugins import setup_plugins
from mediagoblin.init.config import read_mediagoblin_config
from mediagoblin.tools import pluginapi
+from mediagoblin.tests.tools import get_app
def with_cleanup(*modules_to_delete):
@@ -323,3 +324,14 @@ def test_plugin_config():
# the callables thing shouldn't really have anything though.
assert len(config['plugins'][
'mediagoblin.tests.testplugins.callables1']) == 0
+
+
+@pytest.fixture()
+def context_modified_app(request):
+ get_app(
+ request,
+ mgoblin_config=pkg_resources.resource_filename(
+ 'mediagoblin.tests', 'appconfig_context_modified.ini'))
+
+def test_modify_context(context_modified_app):
+ pytest.set_trace()