[FIX] Fixed automated tests using explicit references to the 2011 year
bzr revid: tde@openerp.com-20120102150425-4pcegkfpw9v2aoof
This commit is contained in:
parent
7e8ef0546e
commit
44fb172026
|
@ -2,7 +2,7 @@
|
|||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record id="demo_invoice_0" model="account.invoice">
|
||||
<field name="date_due">2011-07-21</field>
|
||||
<field name="date_due" eval="time.strftime('%Y')+'-01-30'"/>
|
||||
<field name="payment_term" ref="account.account_payment_term"/>
|
||||
<field name="journal_id" ref="account.expenses_journal"/>
|
||||
<field name="currency_id" ref="base.EUR"/>
|
||||
|
@ -15,7 +15,7 @@
|
|||
<field name="type">in_invoice</field>
|
||||
<field name="account_id" ref="account.a_pay"/>
|
||||
<field eval="0" name="reconciled"/>
|
||||
<field name="date_invoice">2011-06-01</field>
|
||||
<field name="date_invoice" eval="time.strftime('%Y')+'-01-01'"/>
|
||||
<field eval="14.0" name="amount_untaxed"/>
|
||||
<field eval="14.0" name="amount_total"/>
|
||||
<field name="partner_id" ref="base.res_partner_maxtor"/>
|
||||
|
|
|
@ -1,13 +1,23 @@
|
|||
|
||||
-
|
||||
In order to test close period wizard I create a period then close it and checked it's state
|
||||
In order to test close period wizard I first create a dummy fiscal year in the past to avoid conflicts related to closed periods
|
||||
-
|
||||
!record {model: account.fiscalyear, id: data_fiscalyear_minus1}:
|
||||
company_id: base.main_company
|
||||
date_start: !eval "'%s-01-01' %(datetime.now().year-1)"
|
||||
date_stop: !eval "'%s-12-31' %(datetime.now().year-1)"
|
||||
name: !eval "'Fiscal Year X %s' %(datetime.now().year-1)"
|
||||
code: !eval "'FY%s' %(datetime.now().year-1)"
|
||||
|
||||
-
|
||||
I create a period then close it and checked it's state
|
||||
-
|
||||
!record {model: account.period, id: account_period_jan0}:
|
||||
company_id: base.main_company
|
||||
date_start: !eval "'%s-01-01' %(datetime.now().year)"
|
||||
date_stop: !eval "'%s-01-31' %(datetime.now().year)"
|
||||
fiscalyear_id: account.data_fiscalyear
|
||||
name: !eval "'Jan-%s' %(datetime.now().year)"
|
||||
date_start: !eval "'%s-01-01' %(datetime.now().year-1)"
|
||||
date_stop: !eval "'%s-01-31' %(datetime.now().year-1)"
|
||||
fiscalyear_id: data_fiscalyear_minus1
|
||||
name: !eval "'Jan-%s' %(datetime.now().year-1)"
|
||||
special: 1
|
||||
|
||||
-
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
address_invoice_id: base.res_partner_address_8invoice
|
||||
company_id: 1
|
||||
account_id: account.a_pay
|
||||
date_invoice: '2011-06-22'
|
||||
date_invoice: !eval "'%s' % (time.strftime('%Y-%m-%d'))"
|
||||
name: selling product
|
||||
type: 'out_invoice'
|
||||
invoice_line:
|
||||
|
@ -48,12 +48,13 @@
|
|||
Then I import a sample EDI document of another customer invoice
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
import time
|
||||
edi_document = {
|
||||
"__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.random_invoice_763jsms",
|
||||
"__module": "account",
|
||||
"__model": "account.invoice",
|
||||
"__version": [6,1,0],
|
||||
"internal_number": "SAJ/2011/002",
|
||||
"internal_number": time.strftime("SAJ/%Y/002"),
|
||||
"company_address": {
|
||||
"__id": "base:b22acf7a-ddcd-11e0-a4db-701a04e25543.main_address",
|
||||
"__module": "base",
|
||||
|
@ -86,7 +87,7 @@
|
|||
"zip": "1367",
|
||||
"country_id": ["base:5af1272e-dd26-11e0-b65e-701a04e25543.be", "Belgium"],
|
||||
},
|
||||
"date_invoice": "2011-06-22",
|
||||
"date_invoice": time.strftime('%Y-%m-%d'),
|
||||
"name": "sample invoice",
|
||||
"tax_line": [{
|
||||
"__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.account_invoice_tax-4g4EutbiEMVl",
|
||||
|
@ -128,7 +129,7 @@
|
|||
assert bank_info.acc_number == "Sample bank: 123465789-156113", 'Expected "Sample bank: 123465789-156113", got %s' % bank_info.acc_number
|
||||
|
||||
assert invoice_new.partner_id.supplier, 'Imported Partner is not marked as supplier'
|
||||
assert invoice_new.reference == "SAJ/2011/002", "internal number is not stored in reference"
|
||||
assert invoice_new.reference == time.strftime("SAJ/%Y/002"), "internal number is not stored in reference"
|
||||
assert invoice_new.reference_type == 'none', "reference type is not set to 'none'"
|
||||
assert invoice_new.internal_number == False, "internal number is not reset"
|
||||
assert invoice_new.journal_id.id, "journal id is not selected"
|
||||
|
|
|
@ -253,5 +253,6 @@
|
|||
I check whether the procurement orders are created or not.
|
||||
-
|
||||
!python {model: procurement.order}: |
|
||||
proc_ids = self.search(cr, uid, [('origin','=','MPS(admin) 2011, week 29'),('product_id','=',ref("product.product_product_pc1"))])
|
||||
import datetime
|
||||
proc_ids = self.search(cr, uid, [('origin','=','MPS(admin) %s, week 29' % (datetime.datetime.now().year)),('product_id','=',ref("product.product_product_pc1"))])
|
||||
assert proc_ids,'No Procurements!'
|
||||
|
|
Loading…
Reference in New Issue