From 46348ccf3150a8b68d03f1f7147e936996d22659 Mon Sep 17 00:00:00 2001 From: Jigar Amin - OpenERP Date: Tue, 29 Nov 2011 10:08:49 +0530 Subject: [PATCH] [RM/ADD] rearragned the yaml and refcetored the yamls bzr revid: jam@tinyerp.com-20111129043849-i0k4udno1x2jklz1 --- addons/resource/__openerp__.py | 2 +- .../test/{ => process}/test_resource.yml | 18 ++++++++++-------- .../test/{ => ui}/on_chnage_resource.yml | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) rename addons/resource/test/{ => process}/test_resource.yml (74%) rename addons/resource/test/{ => ui}/on_chnage_resource.yml (65%) diff --git a/addons/resource/__openerp__.py b/addons/resource/__openerp__.py index 77ce9da3c2c..10626110324 100644 --- a/addons/resource/__openerp__.py +++ b/addons/resource/__openerp__.py @@ -46,8 +46,8 @@ It also manages the leaves of every resource. 'demo_xml': ['resource_demo.xml' ], 'test': [ - 'test/on_chnage_resource.yml', 'test/test_resource.yml', + 'test/on_chnage_resource.yml', ], 'installable': True, 'active': False, diff --git a/addons/resource/test/test_resource.yml b/addons/resource/test/process/test_resource.yml similarity index 74% rename from addons/resource/test/test_resource.yml rename to addons/resource/test/process/test_resource.yml index c1eb392c8b6..df9fd9e2708 100644 --- a/addons/resource/test/test_resource.yml +++ b/addons/resource/test/process/test_resource.yml @@ -1,5 +1,7 @@ +- | + In Order to Test resource : I use the 'Demo resource' from Demo Record, with 38 Hours / week and 9 Hours / Day working calendar scheduled. - - I generate resource detail for the User "Demo" + First, I generate resource detail for the User "Demo" - !python {model: resource.resource}: | res = self.generate_resources(cr, uid, [ref('base.user_demo')], ref('timesheet_group1')) @@ -8,16 +10,16 @@ assert resource.get('efficiency') == 0.8, "Wrong resource has been Generated" assert resource.get('vacation'), 'No vaction calculated' -- - I compute vecation for the reource "Demo Resource" -- - !python {model: resource.resource}: | - res= self.compute_vacation(cr, uid, ref('timesheet_group1'), ref('resource_resource_demorsource')) - assert res, "No vacation generated for the resource 'Demo Resource'." - - I compute the working calendar for the resource 'Demo Resource'. - !python {model: resource.resource}: | res= self.compute_working_calendar(cr, uid, ref('timesheet_group1')) assert res, "No working calendar generated for the resource 'Demo Resource'." + +- + I compute vacation for the resource "Demo Resource" based on his Resource Leave Request(s). +- + !python {model: resource.resource}: | + res= self.compute_vacation(cr, uid, ref('timesheet_group1'), ref('resource_resource_demorsource')) + assert res, "No vacation generated for the resource 'Demo Resource'." diff --git a/addons/resource/test/on_chnage_resource.yml b/addons/resource/test/ui/on_chnage_resource.yml similarity index 65% rename from addons/resource/test/on_chnage_resource.yml rename to addons/resource/test/ui/on_chnage_resource.yml index ade15fb1ade..821b3efa5e4 100644 --- a/addons/resource/test/on_chnage_resource.yml +++ b/addons/resource/test/ui/on_chnage_resource.yml @@ -1,5 +1,5 @@ - - I changing the Resource of the Leave of 'Demo Resource'. + I create resource calendar leave record to call event resource onchange event for "Demo Resource". - !record {model: resource.calendar.leaves, id: resource_calendar_leaves_demoleave1}: calendar_id: resource.timesheet_group1