Skip to content

Commit 5bc4718

Browse files
committed
Fix unittests
1 parent 1303cac commit 5bc4718

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/test_simple_renderer.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ def test_render_not_initialized(loop):
102102

103103
@asyncio.coroutine
104104
def func(request):
105-
return aiohttp_jinja2.render_template('template', request, {})
105+
response = yield from aiohttp_jinja2.render_template(
106+
'template', request, {})
107+
return response
106108

107109
app = web.Application(loop=loop)
108110

@@ -145,9 +147,10 @@ def test_render_template(app_with_template, test_client):
145147

146148
@asyncio.coroutine
147149
def func(request):
148-
return aiohttp_jinja2.render_template(
150+
response = yield from aiohttp_jinja2.render_template(
149151
'tmpl.jinja2', request,
150152
{'head': 'HEAD', 'text': 'text'})
153+
return response
151154

152155
template = '<html><body><h1>{{head}}</h1>{{text}}</body></html>'
153156

@@ -168,9 +171,10 @@ def test_render_template_custom_status(app_with_template, test_client):
168171

169172
@asyncio.coroutine
170173
def func(request):
171-
return aiohttp_jinja2.render_template(
174+
response = yield from aiohttp_jinja2.render_template(
172175
'tmpl.jinja2', request,
173176
{'head': 'HEAD', 'text': 'text'}, status=404)
177+
return response
174178

175179
template = '<html><body><h1>{{head}}</h1>{{text}}</body></html>'
176180

@@ -191,7 +195,9 @@ def test_template_not_found(loop):
191195

192196
@asyncio.coroutine
193197
def func(request):
194-
return aiohttp_jinja2.render_template('template', request, {})
198+
response = yield from aiohttp_jinja2.render_template(
199+
'template', request, {})
200+
return response
195201

196202
app = web.Application(loop=loop)
197203
aiohttp_jinja2.setup(app, loader=jinja2.DictLoader({}))

0 commit comments

Comments
 (0)