def test_renders_given_template_with_given_context(self):
     from flask.ext.generic_views import core
     view = TemplateView()
     (flexmock(view)
         .should_receive('get_template')
         .with_args()
         .and_return('template.html'))
     (flexmock(view)
         .should_receive('get_context')
         .with_args(page=3)
         .and_return({'foo': 'bar', 'params': {'page': 3}}))
     (flexmock(core)
         .should_receive('render_template')
         .with_args('template.html', foo='bar', params={'page': 3})
         .and_return('a response'))
     assert view.render(page=3) == 'a response'