Browse Source
adding unit test and explanation about how to run the unit test and also about how to run YAML tests of module using web_context_tunnel
pull/2/head
adding unit test and explanation about how to run the unit test and also about how to run YAML tests of module using web_context_tunnel
pull/2/head
Raphaël Valyi
11 years ago
2 changed files with 42 additions and 6 deletions
@ -0,0 +1,14 @@ |
|||
openerp.testing.section('context_tunnel', { |
|||
}, function (test) { |
|||
test.dependencies = window['oe_all_dependencies']; |
|||
test("context composition", function (instance) { |
|||
var field_manager = new instance.web.form.DefaultFieldManager(); |
|||
var node = {'attrs': {'context': {'key1': 'value1', 'key2': 'value2'}, 'context_2': {'key3': 'value3'}, 'context_3': {'key4': 'value4'}}} |
|||
var w = new instance.web.form.FormWidget(field_manager, node); |
|||
var context = w.build_context().eval(); |
|||
ok(context['key1'] === 'value1', 'right value for key1 in context'); |
|||
ok(context['key2'] === 'value2', 'right value for key2 in context'); |
|||
ok(context['key3'] === 'value3', 'right value for key3 in context'); |
|||
ok(context['key4'] === 'value4', 'right value for key3 in context'); |
|||
}); |
|||
}); |
Write
Preview
Loading…
Cancel
Save
Reference in new issue