diff options
| author | jam-openerp <jam@tinyerp.com> | 2011-01-11 12:35:46 +0530 |
|---|---|---|
| committer | jam-openerp <jam@tinyerp.com> | 2011-01-11 12:35:46 +0530 |
| commit | 11ad63cfe498ee2cec0d9e8ec756c1e7638f34b8 (patch) | |
| tree | ed0d8f6808a46c5520eab04db2d52c8c0c464fc5 /addons/project_long_term/test | |
| parent | 07f321e727a61253f93138257bea5c4f4250cb3f (diff) | |
[FIX] project_long_term - YAML Fix Date Removed
bzr revid: jam@tinyerp.com-20110111070546-ljjvg2azmfnxhvxz
Diffstat (limited to 'addons/project_long_term/test')
| -rw-r--r-- | addons/project_long_term/test/test_schedule_phases_case1.yml | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/addons/project_long_term/test/test_schedule_phases_case1.yml b/addons/project_long_term/test/test_schedule_phases_case1.yml index 576ac747385..03c49f35c80 100644 --- a/addons/project_long_term/test/test_schedule_phases_case1.yml +++ b/addons/project_long_term/test/test_schedule_phases_case1.yml @@ -5,7 +5,7 @@ I create a project 'Development and Testing'. - !record {model: project.project, id: project_project_project0}: - date_start: '2010-12-30' + date_start: !eval time.strftime('%Y-%m-%d') balance: 0.0 credit: 0.0 currency_id: base.EUR @@ -59,7 +59,12 @@ I check the starting and ending dates of both phases. - !python {model: project.phase}: | + import datetime + from dateutil.relativedelta import * + start = (datetime.date.today()).strftime('%Y-%m-%d') + end = (datetime.date.today() + relativedelta(days=3)).strftime('%Y-%m-%d') first_phase = self.browse(cr, uid, ref('project_phase_firstphase0')) - assert (first_phase.date_start == '2010-12-30' and first_phase.date_end == '2011-01-03'),'Dates are wrong!' + assert (first_phase.date_start >= start and first_phase.date_end <= end),'Dates are wrong!' second_phase = self.browse(cr, uid, ref('project_phase_secondphase0')) - assert (second_phase.date_start == '2011-01-03' and second_phase.date_end == '2011-01-05'),'Dates are wrong!' + end = (datetime.date.today() + relativedelta(days=10)).strftime('%Y-%m-%d') + assert (second_phase.date_start >= first_phase.date_end and second_phase.date_end <= end),'Dates are wrong!' |
