from index import application import unittest from webtest import TestApp, TestResponse import sys from http.cookiejar import CookieJar test_app = TestApp(application, cookiejar=CookieJar()) test_response = TestResponse() sys.path.append('../') # os.environ['WEBTEST_TARGET_URL'] = 'http://*****:*****@teste.com.br", tipo_observador="0")) test_app.post('/login_observador', dict(usuario='Adm', senha='idle')) def _fixaluno_turma_escola(self): res = test_app.post( '/escola_cadastro', dict(nome='cheese shop',
def fixup_response(req): """Make sure the req has a TestResponse response""" if not isinstance(req.response, TestResponse): resp = TestResponse(body=req.response.body, status=req.response.status, headerlist=req.response.headerlist) req.response = resp