[IMP]:yml for double validation
[odoo/odoo.git] / addons / purchase_double_validation / test / process / purchase_double_validation_test.yml
1 -
2   I Create new limit amount from  Configure Limit Amount for Purchase wizard.
3 -
4   !record {model: purchase.double.validation.installer, id: purchase_double_validation_installer_1}:
5     limit_amount: 3000
6 -
7   Then I set the Limit Amount.
8 -
9   !python {model: purchase.double.validation.installer}: |
10     self.execute(cr, uid, [ref("purchase_double_validation_installer_1")])
11 -
12   Test for purchase double validation in which Total > = Limit Amount.
13 -
14   !python {model: purchase.order}: |
15     installer_amount = self.pool.get('purchase.double.validation.installer').browse(cr, uid, ref("purchase_double_validation_installer_1"))
16     purchase_order = self.browse(cr, uid, ref("order_purchase11"))
17     assert purchase_order.amount_total >= installer_amount.limit_amount ,"Total is Greater then the Limit Amount"
18 -
19   In order to test the flow, I confirmed the purchase order.
20 -
21   !workflow {model: purchase.order, action: purchase_confirm, ref: order_purchase11}
22 -
23   I check that the order which was initially in the draft state has transmit to confirm state for double validation.
24 -
25   !assert {model: purchase.order, id: order_purchase11}:
26     - state == 'confirmed'
27 -
28   I Approved the purchase order.
29 -
30   !workflow {model: purchase.order, action: purchase_approve, ref: order_purchase11}
31 -
32   I check that the order which was initially in the confirmed state has transmit to approved state.
33 -
34   !assert {model: purchase.order, id: order_purchase11}:
35     - state == 'approved'
36 -
37   Test for purchase double validation in which Total < = Limit Amount.
38 -
39   !python {model: purchase.order}: |
40     installer_amount = self.pool.get('purchase.double.validation.installer').browse(cr, uid, ref("purchase_double_validation_installer_1"))
41     purchase_order = self.browse(cr, uid, ref("order_purchase12"))
42     assert purchase_order.amount_total <= installer_amount.limit_amount ,"Total is Less then the Limit Amount"
43 -
44   I confirmed the purchase order.
45 -
46   !workflow {model: purchase.order, action: purchase_confirm, ref: order_purchase12}
47 -
48   I check that the order which was initially in the draft state has transmit to confirm state for double validation.
49 -
50   !assert {model: purchase.order, id: order_purchase12}:
51     - state == 'confirmed'
52 -
53   I Approved the purchase order.
54 -
55   !workflow {model: purchase.order, action: purchase_approve, ref: order_purchase12}
56 -
57   I check that the order which was initially in the confirmed state has transmit to approved state.
58 -
59   !assert {model: purchase.order, id: order_purchase12}:
60     - state == 'approved'
61
62