diff --git a/addons/web/static/tests/helpers/test_utils.js b/addons/web/static/tests/helpers/test_utils.js index 37ce9d88fd3..1b9e1ccf57d 100644 --- a/addons/web/static/tests/helpers/test_utils.js +++ b/addons/web/static/tests/helpers/test_utils.js @@ -830,14 +830,17 @@ function patch (target, props) { function unpatch(target) { var patchID = target.__patchID; var patch = patches[patchID]; - _.each(patch.ownPatchedProps, function (p) { - target[p.key] = p.initialValue; - }); if (target.prototype) { + _.each(patch.ownPatchedProps, function (p) { + target.prototype[p.key] = p.initialValue; + }); _.each(patch.otherPatchedProps, function (key) { delete target.prototype[key]; }); } else { + _.each(patch.ownPatchedProps, function (p) { + target[p.key] = p.initialValue; + }); _.each(patch.otherPatchedProps, function (key) { delete target[key]; });