Chris McDonough
2011-08-28 366a7c38c5d59fc4e9b2e72332671c4f440354a0
add an integration test that uses relative renderer names
4 files added
1 files modified
33 ■■■■■ changed files
pyramid/tests/rendererscanapp/__init__.py 9 ●●●●● patch | view | raw | blame | history
pyramid/tests/rendererscanapp/one.pt 4 ●●●● patch | view | raw | blame | history
pyramid/tests/rendererscanapp/two/__init__.py 6 ●●●●● patch | view | raw | blame | history
pyramid/tests/rendererscanapp/two/two.pt 4 ●●●● patch | view | raw | blame | history
pyramid/tests/test_integration.py 10 ●●●●● patch | view | raw | blame | history
pyramid/tests/rendererscanapp/__init__.py
New file
@@ -0,0 +1,9 @@
from pyramid.view import view_config
@view_config(name='one', renderer='one.pt')
def one(request):
    return {'name':'One!'}
def includeme(config):
    config.scan()
pyramid/tests/rendererscanapp/one.pt
New file
@@ -0,0 +1,4 @@
<div xmlns="http://www.w3.org/1999/xhtml"
     xmlns:tal="http://xml.zope.org/namespaces/tal">
   ${name}
</div>
pyramid/tests/rendererscanapp/two/__init__.py
New file
@@ -0,0 +1,6 @@
from pyramid.view import view_config
@view_config(name='two', renderer='two.pt')
def two(request):
    return {'nameagain':'Two!'}
pyramid/tests/rendererscanapp/two/two.pt
New file
@@ -0,0 +1,4 @@
<div xmlns="http://www.w3.org/1999/xhtml"
     xmlns:tal="http://xml.zope.org/namespaces/tal">
  ${nameagain}
</div>
pyramid/tests/test_integration.py
@@ -471,6 +471,16 @@
        res = self.testapp.get('/hello', status=200)
        self.assertTrue('Hello' in res.body)
class RendererScanAppTest(IntegrationBase):
    package = 'pyramid.tests.rendererscanapp'
    def test_root(self):
        res = self.testapp.get('/one', status=200)
        self.assertTrue('One!' in res.body)
    def test_two(self):
        res = self.testapp.get('/two', status=200)
        self.assertTrue('Two!' in res.body)
class DummyContext(object):
    pass