3
テストを実行すると、次のトレースバックが表示されます。フラスコテストシグナルがサポートされていないエラー
in get_context_variable
raise RuntimeError("Signals not supported")
RuntimeError: Signals not supported
__init__.py
from flask_testing import TestCase
from app import create_app, db
class BaseTest(TestCase):
BASE_URL = 'http://localhost:5000/'
def create_app(self):
return create_app('testing')
def setUp(self):
db.create_all()
def tearDown(self):
db.session.remove()
db.drop_all()
def test_setup(self):
response = self.client.get(self.BASE_URL)
self.assertEqual(response.status_code, 200)
test_routes.py
from . import BaseTest
class TestMain(BaseTest):
def test_empty_index(self):
r = self.client.get('/')
self.assert200(r)
self.assertEqual(self.get_context_variable('partners'), None)
エラーがどこから来ているget_context_variable
関数呼び出しがあることが表示されます。私が試してみてassert_template_used
を使ってもこのエラーが出ます。この問題を解決するにはかなり時間がかかります。