[19.0][MIG] auth_jwt: Migration to 19.0
Migration to v19.0
- Update the module version from
18.0.1.0.0to19.0.1.0.0.
Technical changes
- Change of the version field in the manifest to ‘19.0.1.0.0’.
- Replaced the SQL constraint
_sql_constraintswith the new syntaxmodels.Constraint(‘UNIQUE(name)’, ...). - Correction of attribute calls in the request context (e.g. request.env.uid instead of request.uid).
- Updated the use of translation functions, changing from
_()toself.env._()with modernised parameter formatting. - Removed a pylint comment for the jwt dependency.
- In the test file, the search for an existing partner was replaced by the explicit creation of a test partner.
Changes to exceptions
- Improved the format of error messages to use the new translation system with placeholders.
/ocabot migration auth_jwt
Thanks for this migration! Looks good, just a minor comment.
I mark it as change requested, just because it is important to not merge this until we are sure that the tests in
auth_jwt_demopass too (this was forgotten in 17 and 18). Would you like to migrate it too, starting from #846? This migration can be done in this same PR since the modules are so closely related.
Hello @sbidoul , I have migrated the demo module, but it seems that it does not load the demo data in the tests, since in the first test where it checks if the validator exists, it no longer finds it. I have tried to replicate it locally and have managed to do so by manually loading the demo data from the Odoo settings, but not by initialising the auth_jwt_demo module. Do you know why it is not loading in the OCA tests?
Best regards,
Indeed Odoo 19 does not load demo data by default. The general thinking is that this is a good thing and that tests should work independently of demo data. It makes sense to me that tests should not depend on demo data of other modules, but I kind of think depending on demo data of the module itself is okay.
I'm not sure what to do with that here yet. I'll need to look closer.
Ah, I see you have tried to make the linter happy on the js lib. But since that one is copied from elsewhere, it's better to keep it untouched and exclude it in .pre-commit-config.yaml like I did in https://github.com/OCA/server-auth/pull/846/commits/9762fdff57c14846a4ca072ccce2c5c825323d1a.
Hello @sbidoul, have you seen or do you know how we can launch the demo data for the tests? Can the demo data be launched from the test setup in this case?