summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2012-02-29 10:02:48 -0500
committerChris McDonough <chrism@plope.com>2012-02-29 10:02:48 -0500
commit1ab81b7d9bbab2b29f4c58581bf62c5389ad068e (patch)
treeb71962cfbf1ea7106bb5d93fc4b0a8e634fa7e2b
parent28c3135c6dab669bc4bace40cd7f8f22c0a8f997 (diff)
parent17a618c2c8d39147dd053221aa5dcf22c80ae6c2 (diff)
downloadpyramid-1ab81b7d9bbab2b29f4c58581bf62c5389ad068e.tar.gz
pyramid-1ab81b7d9bbab2b29f4c58581bf62c5389ad068e.tar.bz2
pyramid-1ab81b7d9bbab2b29f4c58581bf62c5389ad068e.zip
Merge branch '1.3-branch'
-rw-r--r--docs/narr/hooks.rst6
-rw-r--r--pyramid/tests/test_scaffolds.py36
2 files changed, 3 insertions, 39 deletions
diff --git a/docs/narr/hooks.rst b/docs/narr/hooks.rst
index c44323201..f1a122c6c 100644
--- a/docs/narr/hooks.rst
+++ b/docs/narr/hooks.rst
@@ -42,7 +42,7 @@ and a :term:`scan`, you can replace the Not Found view by using the
from pyramid.view import notfound_view_config
- notfound_view_config()
+ @notfound_view_config()
def notfound(request):
return Response('Not Found, dude', status='404 Not Found')
@@ -64,11 +64,11 @@ views can carry predicates limiting their applicability. For example:
from pyramid.view import notfound_view_config
- notfound_view_config(request_method='GET')
+ @notfound_view_config(request_method='GET')
def notfound_get(request):
return Response('Not Found during GET, dude', status='404 Not Found')
- notfound_view_config(request_method='POST')
+ @notfound_view_config(request_method='POST')
def notfound_post(request):
return Response('Not Found during POST, dude', status='404 Not Found')
diff --git a/pyramid/tests/test_scaffolds.py b/pyramid/tests/test_scaffolds.py
deleted file mode 100644
index ed2c5a993..000000000
--- a/pyramid/tests/test_scaffolds.py
+++ /dev/null
@@ -1,36 +0,0 @@
-import unittest
-
-class TestPyramidTemplate(unittest.TestCase):
- def _getTargetClass(self):
- from pyramid.scaffolds import PyramidTemplate
- return PyramidTemplate
-
- def _makeOne(self, name):
- cls = self._getTargetClass()
- return cls(name)
-
- def test_pre_logger_eq_root(self):
- tmpl = self._makeOne('name')
- vars = {'package':'root'}
- result = tmpl.pre(None, None, vars)
- self.assertEqual(result, None)
- self.assertEqual(vars['package_logger'], 'app')
- self.assertTrue(len(vars['random_string']) == 40)
-
- def test_pre_logger_noteq_root(self):
- tmpl = self._makeOne('name')
- vars = {'package':'notroot'}
- result = tmpl.pre(None, None, vars)
- self.assertEqual(result, None)
- self.assertEqual(vars['package_logger'], 'notroot')
- self.assertTrue(len(vars['random_string']) == 40)
-
- def test_post(self):
- tmpl = self._makeOne('name')
- vars = {'package':'root'}
- L = []
- tmpl.out = lambda msg: L.append(msg)
- result = tmpl.post(None, None, vars)
- self.assertEqual(result, None)
- self.assertEqual(L, ['Welcome to Pyramid. Sorry for the convenience.'])
-