From 12e140872c534b6f0de4ec2bc059e33a056e7e35 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 10 Mar 2011 13:18:27 +0100 Subject: [PATCH] [TEST] attribute-addition features bzr revid: xmo@openerp.com-20110310121827-im1lnvwor0x97ear --- .../base/static/qweb/qweb-test-attributes.xml | 22 ++++++++++++++ addons/base/static/qweb/qweb-test.js.html | 29 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 addons/base/static/qweb/qweb-test-attributes.xml diff --git a/addons/base/static/qweb/qweb-test-attributes.xml b/addons/base/static/qweb/qweb-test-attributes.xml new file mode 100644 index 00000000000..91317d5194b --- /dev/null +++ b/addons/base/static/qweb/qweb-test-attributes.xml @@ -0,0 +1,22 @@ + + +
+ + +
+ + + +
+ + +
+ + + +
+ + +
+ + diff --git a/addons/base/static/qweb/qweb-test.js.html b/addons/base/static/qweb/qweb-test.js.html index 678006f38af..a07c6380d2c 100644 --- a/addons/base/static/qweb/qweb-test.js.html +++ b/addons/base/static/qweb/qweb-test.js.html @@ -130,6 +130,35 @@ equals(render('lower-or-equal-js', {}), 'ok', "Lower or Equal, JS operator"); }); + + module("Attributes manipulation", { + setup: function () { + QWeb.add_template('qweb-test-attributes.xml'); + }, + teardown: function () { + QWeb.templates = []; + QWeb.tag = {}; + QWeb.att = {}; + } + }); + test('Fixed-name attributes', function () { + equals(render('fixed-literal', {}), '
', + "Fixed name and literal attribute value"); + equals(render('fixed-variable', {value: 'ok'}), '
', + "Fixed name and variable attribute value"); + }); + test('Tuple-based attributes', function () { + equals(render('tuple-literal', {}), '
', + "Tuple-based literal attributes"); + equals(render('tuple-variable', {att: ['foo', 'bar']}), '
', + "Tuple-based variable attributes"); + }); + test('Fixed name, formatted value attributes', function () { + equals(render('format-literal', {}), '
', + "Literal format"); + equals(render('format-value', {value:'a'}), '
', + "Valued format"); + }); });