Consider as stringable domain with empty clause
Closes #13414 (grafted from 49a55291512a957e496455f6474a9776e8c2c31c) --HG-- branch : 6.0
This commit is contained in:
+1
-1
@@ -1132,7 +1132,7 @@
|
||||
},
|
||||
stringable: function(domain) {
|
||||
var stringable_ = function(clause) {
|
||||
if (!clause) {
|
||||
if (!clause || jQuery.isEmptyObject(clause)) {
|
||||
return true;
|
||||
}
|
||||
var is_array = function(e) {
|
||||
|
||||
@@ -2106,6 +2106,8 @@
|
||||
});
|
||||
var valid = ['name', '=', 'Doe'];
|
||||
var invalid = ['surname', '=', 'John'];
|
||||
QUnit.ok(parser.stringable([]));
|
||||
QUnit.ok(parser.stringable([[]]));
|
||||
QUnit.ok(parser.stringable([valid]));
|
||||
QUnit.ok(!parser.stringable([invalid]));
|
||||
QUnit.ok(parser.stringable(['AND', valid]));
|
||||
|
||||
@@ -593,6 +593,8 @@ class DomainParserTestCase(TestCase):
|
||||
})
|
||||
valid = ('name', '=', 'Doe')
|
||||
invalid = ('surname', '=', 'John')
|
||||
self.assertTrue(dom.stringable([]))
|
||||
self.assertTrue(dom.stringable([[]]))
|
||||
self.assertTrue(dom.stringable([valid]))
|
||||
self.assertFalse(dom.stringable([invalid]))
|
||||
self.assertTrue(dom.stringable(['AND', valid]))
|
||||
|
||||
Reference in New Issue
Block a user