[ADD] some more escf tests

bzr revid: xmo@openerp.com-20110310085836-prkhe118n27n1xcz
This commit is contained in:
Xavier Morel
2011-03-10 09:58:36 +01:00
parent 952d6395ae
commit 07d4e22551
2 changed files with 17 additions and 1 deletions
@@ -33,6 +33,12 @@
});
test("Formatted escaped data output", function () {
equals("ok", render('escf-noformat-literal', {}), "Render a literal string");
equals("ok", render('escf-simpleformat-variable', {value: 'ok'}),
"Only render an interpolated variable");
equals("[ok]", render('escf-format-variable', {value: 'ok'}),
"Actually formatted variable");
equals('[&lt;ok&gt;]', render('escf-format-variable-with-escapes', {value: '<ok>'}),
"Render a formatted string with data to escape");
});
});
+11 -1
View File
@@ -1,4 +1,5 @@
<templates>
<!-- esc -->
<t t-name="esc-literal">
<t t-esc="'ok'"/>
</t>
@@ -9,8 +10,17 @@
<t t-esc="ok"/>
</t>
<!-- escf -->
<t t-name="escf-noformat-literal">
<t t-escf="ok"/>
</t>
<t t-name="escf-simpleformat-variable">
<t t-escf="#{value}"/>
</t>
<t t-name="escf-format-variable">
<t t-escf="[#{value}]"/>
</t>
<t t-name="escf-format-variable-with-escapes">
<t t-escf="[#{value}]"/>
</t>
</templates>