Pylonsアプリのコントローラーテストをセットアップしようとしています。非常に単純なコントローラーと非常に単純なテストを作成しました。テストは次のようになります。
class TestMainController(TestController):
def test_index(self):
response = self.app.get(url(controller='main', action='index', var1 = '1'), params={'var2':'2'})
print response.req
assert False
一方、コントローラーは次のようになります。
class MainController(BaseController):
def index(self):
print request
print request.params
何らかの理由で、このコードを実行すると、次の出力が得られます。
-------------------- >> begin captured stdout << ---------------------
GET /_test_vars HTTP/1.0
Host: localhost:80
<Request at 0x36d6950 GET http://localhost/_test_vars>
UnicodeMultiDict([])
GET /main/index/?var1=1&var2=2 HTTP/1.0
Host: localhost:80
--------------------- >> end captured stdout << ----------------------
TestAppは適切な要求を送信していると見なしますが、コントローラーにヒットする要求は間違っています。誰かがここで何が起こっているのか分かりますか?現在、テスト中は水中で死んでいます。