Skip to content

Commit

Permalink
add assert to make sure that toolbar_button.css injected to the page
Browse files Browse the repository at this point in the history
  • Loading branch information
nickolai-dr committed Sep 25, 2016
1 parent 53cd7b2 commit 9465143
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/conftest.py
Expand Up @@ -47,7 +47,13 @@ def create(*, debug=False, ssl_ctx=None, **kw):
setup(app, **kw)
port = unused_port

tplt = "<html><body><h1>{{ head }}</h1>{{ text }}</body></html>"
tplt = """
<html>
<head></head>
<body>
<h1>{{ head }}</h1>{{ text }}
</body>
</html>"""
loader = jinja2.DictLoader({'tplt.html': tplt})
aiohttp_jinja2.setup(app, loader=loader)

Expand Down
2 changes: 2 additions & 0 deletions tests/test_middleware.py
Expand Up @@ -13,6 +13,7 @@ def handler(request):
return aiohttp_jinja2.render_template(
'tplt.html', request,
{'head': 'HEAD', 'text': 'text'})

app, url = yield from create_server()
app.router.add_route('GET', '/', handler)

Expand All @@ -24,6 +25,7 @@ def handler(request):
loop=loop, connector=conn)
assert 200 == resp.status
txt = yield from resp.text()
assert 'toolbar_button.css' in txt
assert 'pDebugToolbarHandle' in txt
resp.close()

Expand Down

0 comments on commit 9465143

Please sign in to comment.