Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
6608 Vistas

I got a function that inherits from http.Controller, im trying to test it from a tests.common.HttpCase class but i dont know how to call it, any one tried this?

@http.route('/web/binary/download_vat_diary', type='http', auth="public")
@serialize_exception
def download_vat_diary(self, debug=1, wizard_id=0, filename=''):
filecontent = base64.b64decode(request.env['wizard.vat.diary'].browse(int(wizard_id)).report or '')
return request.make_response(filecontent, [('Content-Type', 'application/excel'),
('Content-Disposition', content_disposition(filename))])
Avatar
Descartar
Mejor respuesta

Odoo controllers use werkzeug so I think the answer is to use the werkzeug test client.

http://werkzeug.pocoo.org/docs/0.13/test/

Avatar
Descartar