XML unit tests don't support context attribute
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
Low
|
Christophe Simonis (OpenERP) |
Bug Description
The developer documentation for writing unit tests says that you can include the context attribute on data, assert, function, and workflow elements. When I try to do that, I get the following error:
AssertionError: Invalid attribute context for element assert, line 16
The developer documentation is here:
http://
Analysis:
I've dug into the code and I think I've found a fix. I will post a merge proposal that contains a failing unit test, plus the fix to make the test pass.
It looks like the code is all there to support the context attribute, but it's not allowed by the RelaxNG schema. I just modified the schema to allow context in the appropriate places.
Related branches
- Olivier Dony (Odoo): Approve (mostly functional)
- Christophe Simonis (OpenERP): Pending requested
-
Diff: 99 lines (+40/-1)4 files modifiedbin/addons/base/__terp__.py (+6/-1)
bin/addons/base/base_data.xml (+10/-0)
bin/addons/base/base_test.xml (+20/-0)
bin/import_xml.rng (+4/-0)
Changed in openobject-server: | |
status: | New → Confirmed |
importance: | Undecided → Low |
Changed in openobject-server: | |
status: | Confirmed → Fix Released |
Changed in openobject-server: | |
milestone: | none → 5.0.10 |
I assigned the bug to Christophe, since he committed a fix for bug lp:541545, which is very similar.