Skip to content

Commit

Permalink
web_context_tunnel v8 port: asset bundle + tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rvalyi committed Sep 19, 2014
1 parent c138bbb commit 58b58af
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 7 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
This module comes with a simple test in static/test/context_tunnel.js.
To run it, open the page /web/tests?mod=web_context_tunnel in your browser
as explained here https://doc.openerp.com/trunk/web/testing
It should also by picked by the Python testing when testing with PhantomJS.
It should also be picked by the Python testing when testing with PhantomJS.
As for testing modules using web_context_tunnel with YAML, yes it's possible.
In fact you need to manually mimic the new web-client behavior by manually
Expand All @@ -82,12 +82,13 @@
""",
'version': '2.0',
'depends': ['web'],
'js': ['static/src/js/context_tunnel.js'],
'data': [
'views/web_context_tunnel.xml',
],
'test': [
'static/test/context_tunnel.js',
],
'css': [],
'auto_install': False,
'installable': False,
'web_preload': False,
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,3 @@ openerp.web_context_tunnel = function(instance) {
return v_context;
};
};


// vim:et fdc=0 fdl=0:
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
openerp.testing.section('context_tunnel', {
dependencies: ['web.list', 'web.form'],
templates: true
}, function (test) {
test.dependencies = window['oe_all_dependencies'];
test("context composition", function (instance) {
new openerp.web_context_tunnel(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);
Expand Down
16 changes: 16 additions & 0 deletions web_context_tunnel/views/web_context_tunnel.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>

<openerp>
<data>
<template id="assets_backend" name="web_context_tunnel assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/web_context_tunnel/static/src/js/context_tunnel.js"></script>
</xpath>
</template>
<template id="qunit_suite" name="web_context_tunnel qunit" inherit_id="web.qunit_suite">
<xpath expr="//head" position="inside">
<script type="text/javascript" src="/web_context_tunnel/static/test/context_tunnel.js"></script>
</xpath>
</template>
</data>
</openerp>

0 comments on commit 58b58af

Please sign in to comment.