Skip to content

Instantly share code, notes, and snippets.

View igiroux's full-sized avatar

Ismaila GIROUX igiroux

  • ikigaiTech
  • Paris
View GitHub Profile
@lost-theory
lost-theory / tests.py
Created August 18, 2012 07:09
mock render_template
from mock import patch #http://pypi.python.org/pypi/mock
import flask
import myapp
@patch('flask.templating._render', return_value='')
def test_mocked_render(mocked):
t = myapp.app.test_client()
print "mocked", repr(t.get("/").data)
print "was _render called?", mocked.called