??????????????QUnit???е???????????ο?????????https://www.odoo.com/documentation/8.0/reference/javascript.html
????????/web/tests???????????????а??????????????????б??
????????嵥???????????£?
????1. __openerp__?????????js??????????
??????????????н?js???д??'test'?У?????????view???????view?????????js???????8.0?????Ч)
????<template id="assets_backend" name="qweb_test" inherit_id="web.qunit_suite">
????<xpath expr="//head" position="inside">
????<script type="text/javascript" src="/px_qweb/static/test/demo.js"></script>
????</xpath>
????</template>
????2. ????js?????д???????
?????????????openerp.testing????????????д??section?????С?
????openerp.testing.section('my.test'??function(test){
????test('my first test'??function(){
????ok(false??"this test has run");
????});
????});
????3.????
????ok(state[??messsage]):???state??????
????strictEqual(actual??expected[??message]):?????????
????notStrictEqual(actual??expected[??message]):???????????
????deepEqual(actual??expected[??message]):????????????????????????????????????
????notDeepEqual(actual??expected[??message]):??deepEqual??
????throws(block[??expected][??messsage]):block???????????????????????(expected)????
????equal(actual??expected[??message]):??????????
????notEqual(actual??expected[??message]):??equal??
?????????
?????????data.js?????
????(function(){
????openerp.px_qweb =  {
????value_true:true??
????SomeType: openerp.web.Class.extend({
????init:function(value){
????this.value = value;
????}
????})
????};
????}());
????????????
????openerp.testing.section('PX QWeb'??function(test){
????test('PX Test'??function(instance){
????ok(instance.px_qweb.value_true??'should have a true value');
????var type_instance = new instance.px_qweb.SomeType(50);
????strictEqual(type_instance.value??50??'should have provided value.');
????});
????});