aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests/test_pluginapi.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2013-05-15 11:40:28 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2013-05-15 11:40:28 -0500
commita1099bba79077c1258e586e2e2cbfe0094f10118 (patch)
treebf813a8ab2c5cb6f0110d4ba7f15d48a31313490 /mediagoblin/tests/test_pluginapi.py
parent38ebd05d1a759c3a057ab041124c313cf5724dc4 (diff)
downloadmediagoblin-a1099bba79077c1258e586e2e2cbfe0094f10118.tar.lz
mediagoblin-a1099bba79077c1258e586e2e2cbfe0094f10118.tar.xz
mediagoblin-a1099bba79077c1258e586e2e2cbfe0094f10118.zip
Testing the template_context_prerender hook
This allows for modifying any context *right before render*, including access to the variables that are passed in. This test takes advantage of that and takes one of the variables, "doubleme", and modifies it (doubles it!) In our case it turns "happy" and "joy" into "happyhappy" and "joyjoy". This commit sponsored by Mark Holmquist. Thank you!
Diffstat (limited to 'mediagoblin/tests/test_pluginapi.py')
-rw-r--r--mediagoblin/tests/test_pluginapi.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mediagoblin/tests/test_pluginapi.py b/mediagoblin/tests/test_pluginapi.py
index 74a00ce0..73ad235e 100644
--- a/mediagoblin/tests/test_pluginapi.py
+++ b/mediagoblin/tests/test_pluginapi.py
@@ -348,11 +348,13 @@ def test_modify_context(context_modified_app):
specific thing: in yer specificpage
global thing: globally appended!
-something: orother"""
+something: orother
+doubleme: happyhappy"""
# General test, should have global context variable only
result = context_modified_app.get("/modify_context/")
assert result.body.strip() == """General page!
global thing: globally appended!
-lol: cats"""
+lol: cats
+doubleme: joyjoy"""