最小限の例として、私のFlaskアプリケーションには次のviews
ようなモジュールがあります
from flask import render_template
from something import some_service
def home():
foo = some_service.do_thing('bar')
return render_template('index.html', foo=foo)
私は次のようなテストセットアップを持っています
from application import app
from flask.ext.testing import TestCase
class MyTest(TestCase):
def create_app(self):
app.config['TESTING'] = True
app.config['WTF_CSRF_ENABLED'] = False
return app
def setUp(self):
self.app = app.test_client()
def test_home(self):
rv = self.app.get('/home')
???
test_home
呼び出されたと主張するように書くにはどうすればよいsome_service.do_thing('bar')
ですか?