[IMP]project_gtd: Improve the test cases
bzr revid: dbr@tinyerp.com-20110831071720-5tlklk61p1os7ikj
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
-
|
||||
Create concepts defined by the Getting Things Done methodology.
|
||||
-
|
||||
-
|
||||
Create a task 'Develop time management module' with monthly timebox
|
||||
-
|
||||
-
|
||||
!record {model: project.task, id: project_task_developtimemanagementmodule0}:
|
||||
name: Develop time management module
|
||||
planned_hours: 15.0
|
||||
@@ -10,14 +8,24 @@
|
||||
remaining_hours: 15.0
|
||||
state: draft
|
||||
timebox_id: project_gtd.timebox_monthly
|
||||
-
|
||||
Create view for 'Develop time management module'.
|
||||
-
|
||||
-
|
||||
Copy the task
|
||||
-
|
||||
!python {model: project.task}: |
|
||||
self.fields_view_get(cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False)
|
||||
-
|
||||
Open the 'Develop time management module' task
|
||||
-
|
||||
self.copy_data(cr, uid, ref("project_task_developtimemanagementmodule0"), default=None, context=None)
|
||||
-
|
||||
Change the time to next
|
||||
-
|
||||
!python {model: project.task}: |
|
||||
self.next_timebox(cr, uid, [ref("project_task_developtimemanagementmodule0")])
|
||||
-
|
||||
Change the time to previous
|
||||
-
|
||||
!python {model: project.task}: |
|
||||
self.prev_timebox(cr, uid, [ref("project_task_developtimemanagementmodule0")])
|
||||
-
|
||||
Open the task
|
||||
-
|
||||
!python {model: project.task}: |
|
||||
self.do_open(cr, uid, [ref("project_task_developtimemanagementmodule0")], {"lang":
|
||||
"en_US", "project_id": False, "tz": False, "active_model": "ir.ui.menu",
|
||||
@@ -25,62 +33,47 @@
|
||||
False, "search_default_user_id": 1, "search_default_current": 1, "active_ids":
|
||||
[ref("project.menu_action_view_task")], "active_id": ref("project.menu_action_view_task"),
|
||||
})
|
||||
-
|
||||
-
|
||||
Create time box for next week
|
||||
-
|
||||
-
|
||||
!record {model: project.gtd.timebox, id: project_gtd_timebox_nextweek0}:
|
||||
name: Next Week
|
||||
sequence: 0.0
|
||||
-
|
||||
-
|
||||
Create time box for tomorrow
|
||||
-
|
||||
-
|
||||
!record {model: project.gtd.timebox, id: project_gtd_timebox_tomorrow1}:
|
||||
name: Tomorrow
|
||||
sequence: 0.0
|
||||
-
|
||||
-
|
||||
Planify the task from monthly timebox to tomorrow timebox
|
||||
-
|
||||
-
|
||||
!record {model: project.timebox.fill.plan, id: project_timebox_fill_plan_0}:
|
||||
task_ids:
|
||||
- project_task_developtimemanagementmodule0
|
||||
timebox_id: project_gtd.timebox_monthly
|
||||
timebox_to_id: project_gtd_timebox_tomorrow1
|
||||
-
|
||||
-
|
||||
Set the task to tomorrow timebox
|
||||
-
|
||||
-
|
||||
!python {model: project.timebox.fill.plan}: |
|
||||
context={"lang": "en_US",
|
||||
self._get_from_tb(cr, uid, context=None)
|
||||
self._get_to_tb(cr, uid, context=None)
|
||||
self.process(cr, uid, [ref("project_timebox_fill_plan_0")], {"lang": "en_US",
|
||||
"project_id": False, "tz": False, "active_model": "project.gtd.timebox",
|
||||
"department_id": False, "section_id": False, "record_id": 1, "active_ids":
|
||||
[ref("project_gtd.timebox_daily")], "active_id": ref("project_gtd.timebox_daily"),
|
||||
}
|
||||
self.process(cr, uid, [ref("project_timebox_fill_plan_0")], context=context)
|
||||
self._get_from_tb(cr, uid, context=context)
|
||||
self._get_to_tb(cr, uid, context=context)
|
||||
-
|
||||
Copy the task 'Develop time management module'.
|
||||
-
|
||||
!python {model: project.task}: |
|
||||
self.copy_data(cr, uid, ref('project_task_developtimemanagementmodule0'), default=None, context=None)
|
||||
})
|
||||
-
|
||||
Check if task set to tomorrow timebox
|
||||
-
|
||||
!assert {model: project.task, id: project_task_developtimemanagementmodule0, string: Task set to tomorrow timebox}:
|
||||
- timebox_id.id == ref("project_gtd_timebox_tomorrow1")
|
||||
-
|
||||
Click on Next button.
|
||||
-
|
||||
!python {model: project.task}: |
|
||||
self.next_timebox(cr, uid, [ref('project_task_developtimemanagementmodule0')])
|
||||
-
|
||||
Click on Previous button.
|
||||
-
|
||||
!python {model: project.task}: |
|
||||
self.prev_timebox(cr, uid, [ref('project_task_developtimemanagementmodule0')])
|
||||
-
|
||||
Empty Timebox for tomorrow
|
||||
-
|
||||
!python {model: project.timebox.empty}: |
|
||||
self.view_init(cr , uid , fields_list={}, context=None)
|
||||
self._empty(cr, uid, {"lang": "en_US",
|
||||
"project_id": False, "tz": False, "active_model": "project.gtd.timebox",
|
||||
"department_id": False, "section_id": False, "record_id": 1, "active_ids":
|
||||
@@ -89,6 +82,5 @@
|
||||
-
|
||||
Check task 'Develop time management module' is no more in tomorrow timebox
|
||||
-
|
||||
!assert {model: project.task, id: project_task_developtimemanagementmodule0, string: Task is not in tomorrow timebox}:
|
||||
!assert {model: project.task, id: project_task_developtimemanagementmodule0, string: Task is not in tomorrow timebox}:
|
||||
- timebox_id.id != ref("project_gtd_timebox_tomorrow1")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user