Testing web routes

It ‘s possible testing the endpoints of a module by running your test using run-rest.py?

Indeed you can use the werkzeug.test.Client. You can see an example in trytond/tests/test_routes.py.
But such tests are not transactional, each request has its own transaction which is committed.
Also I would advise to limit the code in the route and instead put the business code in a method on the Model that the route is calling.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.