From a8e600ed71c1972d8934d0853f6abdc1052bc804 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Thu, 22 Dec 2011 11:32:53 +0530 Subject: [PATCH] [IMP] account_payment: Improved sentence formation in ymls. bzr revid: uco@tinyerp.com-20111222060253-5yf56zm2jkx6fctt --- addons/account_payment/__openerp__.py | 4 +- .../test/account_payment_report.yml | 4 +- .../test/cancel_payment_order.yml | 30 +++++++++++++ .../test/draft2cancel_payment_order.yml | 30 ------------- ...nt_order.yml => payment_order_process.yml} | 42 +++++++++---------- 5 files changed, 54 insertions(+), 56 deletions(-) create mode 100644 addons/account_payment/test/cancel_payment_order.yml delete mode 100644 addons/account_payment/test/draft2cancel_payment_order.yml rename addons/account_payment/test/{draft2done_payment_order.yml => payment_order_process.yml} (73%) diff --git a/addons/account_payment/__openerp__.py b/addons/account_payment/__openerp__.py index a6651d53b1f..8905d9aa208 100644 --- a/addons/account_payment/__openerp__.py +++ b/addons/account_payment/__openerp__.py @@ -52,8 +52,8 @@ This module provides : 'demo_xml': ['account_payment_demo.xml'], 'test': [ 'test/account_payment_demo.yml', - 'test/draft2cancel_payment_order.yml', - 'test/draft2done_payment_order.yml', + 'test/cancel_payment_order.yml', + 'test/payment_order_process.yml', 'test/account_payment_report.yml' ], 'installable': True, diff --git a/addons/account_payment/test/account_payment_report.yml b/addons/account_payment/test/account_payment_report.yml index 4bb607a6f47..8786841bf1a 100644 --- a/addons/account_payment/test/account_payment_report.yml +++ b/addons/account_payment/test/account_payment_report.yml @@ -1,8 +1,8 @@ - - In order to test the PDF reports defined on Account Payment, Print a Payment Order + In order to test the PDF reports defined on Account Payment, I print a Payment Order report. - !python {model: payment.order}: | import netsvc, tools, os (data, format) = netsvc.LocalService('report.payment.order').create(cr, uid, [ref('payment_order_1')], {}, {}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'account_payment-payment_order_report.'+format), 'wb+').write(data) \ No newline at end of file + file(os.path.join(tools.config['test_report_directory'], 'account_payment-payment_order_report.'+format), 'wb+').write(data) diff --git a/addons/account_payment/test/cancel_payment_order.yml b/addons/account_payment/test/cancel_payment_order.yml new file mode 100644 index 00000000000..9337581f219 --- /dev/null +++ b/addons/account_payment/test/cancel_payment_order.yml @@ -0,0 +1,30 @@ +- + In order to test the process of cancelling the payment order, +- + I confirm payment order. +- + !workflow {model: payment.order, action: open, ref: payment_order_1} +- + I check that payment order is now "Confirmed". +- + !assert {model: payment.order, id: payment_order_1, severity: error, string: Payment Order should be 'Confirmed'.}: + - state == 'open' +- + Now, I cancel the payment order. +- + !workflow {model: payment.order, action: cancel, ref: payment_order_1} +- + I check that payment order is now "Cancelled". +- + !assert {model: payment.order, id: payment_order_1, severity: error, string: Payment Order should be 'Cancelled'.}: + - state == 'cancel' +- + I again set the payment order to draft. +- + !python {model: payment.order}: | + self.set_to_draft(cr, uid, [ref("payment_order_1")]) +- + I check that payment order is now "Draft". +- + !assert {model: payment.order, id: payment_order_1, severity: error, string: Payment Order should be in 'Draft' state.}: + - state == 'draft' diff --git a/addons/account_payment/test/draft2cancel_payment_order.yml b/addons/account_payment/test/draft2cancel_payment_order.yml deleted file mode 100644 index 7ce89c8550e..00000000000 --- a/addons/account_payment/test/draft2cancel_payment_order.yml +++ /dev/null @@ -1,30 +0,0 @@ -- - In order to test the process of payment order -- - I confirm payment order. -- - !workflow {model: payment.order, action: open, ref: payment_order_1} -- - I check that Payment order is now "Confirmed". -- - !assert {model: payment.order, id: payment_order_1, severity: error, string: Payment Order should be 'Confirmed' state}: - - state == 'open' -- - In order to not payment line so I perform action to change the state of payment order to "cancel". -- - !workflow {model: payment.order, action: cancel, ref: payment_order_1} -- - I check that Payment order is now "cancelled". -- - !assert {model: payment.order, id: payment_order_1, severity: error, string: Payment Order should be in 'Confirmed' state}: - - state == 'cancel' -- - I set the payment order in "Draft" state. -- - !python {model: payment.order}: | - self.set_to_draft(cr, uid, [ref("payment_order_1")]) -- - I check that Payment order is now "draft". -- - !assert {model: payment.order, id: payment_order_1, severity: error, string: Payment Order should be in 'Draft' state}: - - state == 'draft' \ No newline at end of file diff --git a/addons/account_payment/test/draft2done_payment_order.yml b/addons/account_payment/test/payment_order_process.yml similarity index 73% rename from addons/account_payment/test/draft2done_payment_order.yml rename to addons/account_payment/test/payment_order_process.yml index ae850a794bf..2bb04807a64 100644 --- a/addons/account_payment/test/draft2done_payment_order.yml +++ b/addons/account_payment/test/payment_order_process.yml @@ -1,16 +1,16 @@ - - In order to test the process of supplier invoice, I enter the amount for a total of invoice + In order to test the process of payment order, I start with the supplier invoice. - !python {model: account.invoice}: | self.write(cr, uid, [ref('account.demo_invoice_0')], {'check_total': 14}) - - In order to test account move line of journal, I check that there is no move attached to the invoice at draft + In order to test account move line of journal, I check that there is no move attached to the invoice. - !python {model: account.invoice}: | invoice = self.browse(cr, uid, ref("account.demo_invoice_0")) - assert (not invoice.move_id), "Move wrongly created at draft" + assert (not invoice.move_id), "Moves are wrongly created for invoice." - - I change the state of invoice to "open". + I open the invoice. - !workflow {model: account.invoice, action: invoice_open, ref: account.demo_invoice_0} - @@ -19,28 +19,26 @@ !assert {model: account.invoice, id: account.demo_invoice_0, severity: error, string: Invoice should be in 'Open' state}: - state == 'open' - - I change the state of Payment Order to "Confirmed". + I confirm the payment order. - !workflow {model: payment.order, action: open, ref: payment_order_1} - - I check that Payment order is now "Confirmed". + I check that payment order is now "Confirmed". - - !assert {model: payment.order, id: payment_order_1, severity: error, string: Payment Order should be in 'Confirmed' state}: + !assert {model: payment.order, id: payment_order_1, severity: error, string: Payment Order should be 'Confirmed'.}: - state == 'open' -- - I create a record for payment order create. - !record {model: payment.order.create, id: payment_order_create_0}: duedate: !eval time.strftime('%Y-%m-%d') - - I perform a action to search the entries for create a payment line + I search for the invoice entries to make the payment. - !python {model: payment.order.create}: | self.search_entries(cr, uid, [ref("payment_order_create_0")], { "active_model": "payment.order", "active_ids": [ref("payment_order_1")], "active_id": ref("payment_order_1"), }) - - In order to make entries in payment line, I create a entries. + I create payment lines entries. - !python {model: payment.order.create}: | invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account.demo_invoice_0")) @@ -50,7 +48,7 @@ "active_model": "payment.order", "active_ids": [ref("payment_order_1")], "active_id": ref("payment_order_1")}) - - I check a payment line is created with proper data. + I check that payment line is created with proper data. - !python {model: payment.order}: | invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account.demo_invoice_0")) @@ -59,27 +57,27 @@ assert payment_line.move_line_id, "move line is not created in payment line." assert invoice.move_id.name == payment_line.ml_inv_ref.number, "invoice reference number is not same created." - assert invoice.partner_id == payment_line.partner_id, "partner is not same created." - assert invoice.date_due == payment_line.ml_maturity_date, "due date is not same created." - assert invoice.amount_total == payment_line.amount, "payment amount is not same created." + assert invoice.partner_id == payment_line.partner_id, "Partner is not correct." + assert invoice.date_due == payment_line.ml_maturity_date, "Due date is not correct." + assert invoice.amount_total == payment_line.amount, "Payment amount is not correct." - - I change the state of payment order to "done". + After making all payments, I finish the payment order. - !python {model: payment.order}: | self.set_done(cr, uid, [ref("payment_order_1")]) - - I check that Payment order is now "done". + I check that payment order is now "Done". - !assert {model: payment.order, id: payment_order_1, severity: error, string: Payment Order should be in 'Done' state}: - state == 'done' - - I check a payment order is done with proper data. + I check that payment order is done with proper data. - !python {model: payment.order}: | payment = self.browse(cr, uid, ref("payment_order_1")) - assert payment.date_done, "date is not created after done payment order" + assert payment.date_done, "Date is not created." - - I create a record for bank statement. + I create a bank statement. - !record {model: account.bank.statement, id: account_bank_statement_1}: balance_end_real: 0.0 @@ -89,7 +87,7 @@ name: / period_id: account.period_10 - - In order to make entries in bank statement line, I import payment order lines. + I import payment order lines for the bank statement. - !python {model: account.payment.populate.statement}: | payment = self.pool.get('payment.order').browse(cr, uid, ref("payment_order_1")) @@ -106,4 +104,4 @@ line_id = self.browse(cr, uid,payment.line_ids[0].id,context) assert line_id.info_owner, "Owner Account not proper." assert line_id.info_partner, "Destination Account not proper." - assert line_id.ml_inv_ref, "Invoice reference is not proper." \ No newline at end of file + assert line_id.ml_inv_ref, "Invoice reference is not proper."