[IMP]sale: Improve code for run_scheduler.yml
authorDBR (OpenERP) <dbr@tinyerp.com>
Wed, 16 Nov 2011 07:24:03 +0000 (12:54 +0530)
committerDBR (OpenERP) <dbr@tinyerp.com>
Wed, 16 Nov 2011 07:24:03 +0000 (12:54 +0530)
bzr revid: dbr@tinyerp.com-20111116072403-padjtci09myqal0t

addons/sale/test/process/run_scheduler.yml

index 42ca287..a7211dc 100644 (file)
@@ -16,9 +16,8 @@
 -
   I run the scheduler.
 -
-  !function {model: procurement.order, name: run_scheduler}:
-    - model: procurement.order
-      search: "[('state','=','confirmed')]"
+  !python {model: procurement.order}: |
+    self.run_scheduler(cr, uid)
 -
   I check that the procurement for the product PC2 is in exception state.
   As PC2 product's supply method is produce and the BoM is not defined.
@@ -26,7 +25,4 @@
   !python {model: procurement.order}: |
     from tools.translate import _
     proc_ids = self.search(cr, uid, [('state','=','exception'),('product_id','=',ref('product.product_product_pc2'))])
-    try:
-      assert not proc_ids, _('There is no procurement in exception state!')
-    except:
-      pass
+    assert proc_ids, _('There is no procurement in exception state!')