Skip to content

password_security module throws warning during tests #141

@jmcvetta

Description

@jmcvetta

The password_security module throws a warning during tests. Although it is just a warning, it makes odoo.sh flag the tests as yellow. So an Odoo instance using password_security cannot pass its tests on odoo.sh.

Sample warning from the log:

2019-10-10 11:18:13,150 7 WARNING jmcvetta-dev-632767 odoo.http: <function odoo.addons.password_security.controllers.main.web_auth_signup> returns an invalid response type for an http request 

Warning is thrown from within odoo.http.route decorator, which is wrapping password_security.controllers.main.web_auth_signup().

Within that method we have the line:

            return request.render('auth_signup.signup', qcontext)

@route is unhappy because the response from request.render() is an instance of MagicMock. Whereas @route is expecting an instance of odoo.http.Response, or one of a few other types.

Need to change the mocking setup, so the MagicMock object will report itself as an instance of odoo.http.Response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    stalePR/Issue without recent activity, it'll be soon closed automatically.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions