From ac9434002dd4d0026627ce81f8716e6ee646a7f0 Mon Sep 17 00:00:00 2001 From: Thibault Francois Date: Mon, 31 Jan 2011 13:38:54 +0100 Subject: [PATCH] [FIX] Yaml test : day+1 etc .. bzr revid: tfr@openerp.com-20110131123854-wh09jiyb5x2mpuiq --- addons/crm/test/test_crm_meeting.yml | 2 +- addons/crm/test/test_crm_opportunity.yml | 4 ++-- addons/crm/test/test_crm_phonecall.yml | 6 +++--- addons/hr_payroll/test/payroll_register.yml | 2 +- addons/hr_recruitment/test/test_hr_recruitment.yml | 4 ++-- addons/lunch/test/test_lunch.yml | 2 +- addons/membership/test/test_membership.yml | 4 ++-- addons/point_of_sale/test/point_of_sale_report.yml | 2 +- addons/point_of_sale/test/point_of_sale_test.yml | 2 +- addons/project_planning/test/planning_states.yml | 4 ++-- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/addons/crm/test/test_crm_meeting.yml b/addons/crm/test/test_crm_meeting.yml index d7c8a4691d6..ae52a747bf2 100644 --- a/addons/crm/test/test_crm_meeting.yml +++ b/addons/crm/test/test_crm_meeting.yml @@ -7,7 +7,7 @@ !record {model: crm.meeting, id: crm_meeting_regardingpresentation0}: categ_id: crm.categ_meet2 date: !eval time.strftime('%Y-%m-%d 16:04:00') - date_deadline: !eval "'%s-%s-%s 00:04:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" + date_deadline: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 00:04:00')" duration: 8.0 email_from: info@balmerinc.be location: Ahmedabad diff --git a/addons/crm/test/test_crm_opportunity.yml b/addons/crm/test/test_crm_opportunity.yml index 3a25db66381..29300bcf111 100644 --- a/addons/crm/test/test_crm_opportunity.yml +++ b/addons/crm/test/test_crm_opportunity.yml @@ -51,7 +51,7 @@ I click on "schedule call" button and select planned date for the call. - !record {model: crm.opportunity2phonecall, id: crm_opportunity2phonecall_abcfuelcounits0}: - date: !eval "'%s-%s-%s 11:15:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" + date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')" name: 'ABC FUEL CO 829264 - 10002 units' section_id: crm.section_sales_department user_id: base.user_demo @@ -72,7 +72,7 @@ I can see phonecall record after click on "Schedule call" wizard. - !record {model: crm.phonecall, id: crm_phonecall_abcfuelcounits0}: - date: !eval "'%s-%s-%s 11:15:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" + date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')" duration: 3.0 name: 'ABC FUEL CO 829264 - 10002 units' partner_address_id: base.res_partner_address_1 diff --git a/addons/crm/test/test_crm_phonecall.yml b/addons/crm/test/test_crm_phonecall.yml index 98020d345e6..1885e34a5ce 100644 --- a/addons/crm/test/test_crm_phonecall.yml +++ b/addons/crm/test/test_crm_phonecall.yml @@ -64,8 +64,8 @@ - !record {model: crm.meeting, id: crm_meeting_interviewcall0}: alarm_id: base_calendar.alarm3 - date: !eval "'%s-%s-%s 09:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" - date_deadline: !eval "'%s-%s-%s 17:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" + date: !eval "'%s-%s-%s 09:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day)" + date_deadline: !eval "'%s-%s-%s 17:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day)" duration: 8.0 email_from: info@balmerinc.be name: Interview call @@ -81,7 +81,7 @@ phonecall. - !record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_interviewcall0}: - date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" + date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year,datetime.now().month,datetime.now().day)" name: Interview call section_id: crm.section_sales_department user_id: base.user_root diff --git a/addons/hr_payroll/test/payroll_register.yml b/addons/hr_payroll/test/payroll_register.yml index 4a16dafe6ed..41231e361db 100644 --- a/addons/hr_payroll/test/payroll_register.yml +++ b/addons/hr_payroll/test/payroll_register.yml @@ -26,7 +26,7 @@ I create a payroll register record. - !record {model: hr.payroll.register, id: hr_payroll_register_payroll0}: - date: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" + date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d')" line_ids: - employee_id: hr_payroll.hr_employee_keith0 name: payroll1 diff --git a/addons/hr_recruitment/test/test_hr_recruitment.yml b/addons/hr_recruitment/test/test_hr_recruitment.yml index ae322475a62..870226a91f0 100644 --- a/addons/hr_recruitment/test/test_hr_recruitment.yml +++ b/addons/hr_recruitment/test/test_hr_recruitment.yml @@ -84,8 +84,8 @@ !record {model: crm.meeting, id: crm_meeting_fresher0}: alarm_id: base_calendar.alarm1 count: 0.0 - date: !eval "'%s-%s-%s 00:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" - date_deadline: !eval "'%s-%s-%s 08:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" + date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 00:00:00')" + date_deadline: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 08:00:00')" day: 0.0 duration: 8.0 name: Fresher diff --git a/addons/lunch/test/test_lunch.yml b/addons/lunch/test/test_lunch.yml index 0b5e756f8b3..ae41c7f20ab 100644 --- a/addons/lunch/test/test_lunch.yml +++ b/addons/lunch/test/test_lunch.yml @@ -66,7 +66,7 @@ I create a new lunch order "LU002" for the "Club1" product, at another date. - !record {model: lunch.order, id: lunch_order_1}: - date: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month,datetime.now().day+2)" + date: !eval "(datetime.now() + timedelta(2)).strftime('%Y-%m-%d')" product: 'lunch_product_club1' price: 2.75 user_id: base.user_root diff --git a/addons/membership/test/test_membership.yml b/addons/membership/test/test_membership.yml index 195fbd15b01..4f3f5c0d493 100644 --- a/addons/membership/test/test_membership.yml +++ b/addons/membership/test/test_membership.yml @@ -7,7 +7,7 @@ categ_id: product.cat1 membership: 1 membership_date_from: !eval datetime.today().strftime("%Y-%m-%d") - membership_date_to: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month+6,datetime.now().day)" + membership_date_to: !eval "(datetime.now() + timedelta(6*31)).strftime('%Y-%m-%d')" name: Golden Membership type: service list_price: 80.00 @@ -103,7 +103,7 @@ categ_id: product.cat1 membership: 1 membership_date_from: !eval datetime.today().strftime("%Y-%m-%d") - membership_date_to: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month+6,datetime.now().day)" + membership_date_to: !eval "(datetime.now() + timedelta(6*31)).strftime('%Y-%m-%d')" name: Silver Membership type: service list_price: 50.00 diff --git a/addons/point_of_sale/test/point_of_sale_report.yml b/addons/point_of_sale/test/point_of_sale_report.yml index 323d227f7d2..b821dc899df 100644 --- a/addons/point_of_sale/test/point_of_sale_report.yml +++ b/addons/point_of_sale/test/point_of_sale_report.yml @@ -93,7 +93,7 @@ journal_id: account_journal_cash0 line_ids: - name: statement - date: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month+5,datetime.now().day)" + date: !eval "(datetime.now() + timedelta(5*31)).strftime('%Y-%m-%d')" type: customer account_id: account_pos_account_sales amount: 100 diff --git a/addons/point_of_sale/test/point_of_sale_test.yml b/addons/point_of_sale/test/point_of_sale_test.yml index c8ed72e386f..2fcfbaaf5eb 100644 --- a/addons/point_of_sale/test/point_of_sale_test.yml +++ b/addons/point_of_sale/test/point_of_sale_test.yml @@ -290,7 +290,7 @@ !record {model: pos.order, id: pos_order_pos0}: company_id: base.main_company date_order: !eval time.strftime('%Y-%m-%d %H:%M:%S') - date_validity: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month+6,datetime.now().day)" + date_validity: !eval "(datetime.now() + timedelta(6*1)).strftime('%Y-%m-%d')" lines: - company_id: base.main_company name: Order Line/01 diff --git a/addons/project_planning/test/planning_states.yml b/addons/project_planning/test/planning_states.yml index 5d40a199280..5f7433125de 100644 --- a/addons/project_planning/test/planning_states.yml +++ b/addons/project_planning/test/planning_states.yml @@ -4,7 +4,7 @@ !record {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0}: business_days: 20 date_from: !eval time.strftime('%Y-%m-%d') - date_to: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month+1,datetime.now().day)" + date_to: !eval "(datetime.now() + timedelta(31)).strftime('%Y-%m-%d')" name: Project Planning state: draft user_id: base.user_demo @@ -83,4 +83,4 @@ Check if planning in done state - !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in done state}: - - state == "done" \ No newline at end of file + - state == "done"