[MERGE] project_issue: clean yml tests

bzr revid: rco@openerp.com-20111215120929-ehr5bxnbbq1bsqyj
This commit is contained in:
Raphael Collet 2011-12-15 13:09:29 +01:00
commit 2432b9d0f9
9 changed files with 193 additions and 147 deletions

View File

@ -54,8 +54,10 @@ and decide on their status as they evolve.
],
'demo_xml': ['project_issue_demo.xml'],
'test': [
'test/convert_issue_to_task.yml',
'test/test_project_issue_states.yml'
'test/subscribe_issue.yml',
'test/issue_process.yml',
'test/cancel_issue.yml',
'test/issue_demo.yml'
],
'installable': True,
'active': False,

View File

@ -314,7 +314,8 @@ class project_issue(crm.crm_case, osv.osv):
'description':bug.description,
'date_deadline': bug.date,
'project_id': bug.project_id.id,
'priority': bug.priority,
# priority must be in ['0','1','2','3','4'], while bug.priority is in ['1','2','3','4','5']
'priority': str(int(bug.priority) - 1),
'user_id': bug.user_id.id,
'planned_hours': 0.0,
})

View File

@ -0,0 +1,60 @@
-
In order to test process of issue tracking in OpenERP, I cancel the unqualified Issue.
-
!python {model: project.issue}: |
self.case_cancel(cr, uid, [ref("crm_case_buginaccountsmodule0")])
-
I check the issue is in cancel state.
-
!assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue is in cancel state}:
- state == 'cancel'
-
I re-open the Issue.
-
!python {model: project.issue}: |
self.case_open(cr, uid, [ref("crm_case_buginaccountsmodule0")])
-
I check the state of issue after open it.
-
!assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue is in open state}:
- state == 'open'
-
I put the issue in pending state.
-
!python {model: project.issue}: |
self.case_pending(cr, uid, [ref("crm_case_buginaccountsmodule0")])
-
I check the state of issue after put it in pending state.
-
!assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in pending state}:
- state == 'pending'
-
I cancel the issue is in pending state.
-
!python {model: project.issue}: |
self.case_cancel(cr, uid, [ref("crm_case_buginaccountsmodule0")])
-
I check the issue is in cancel state.
-
!assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue is in cancel state}:
- state == 'cancel'
-
I close Issue.
-
!python {model: project.issue}: |
self.case_close(cr, uid, [ref("crm_case_buginaccountsmodule0")])
-
I check state of Issue after close.
-
!assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue is in done state}:
- state == 'done'
-
I cancel the issue is in done state.
-
!python {model: project.issue}: |
self.case_cancel(cr, uid, [ref("crm_case_buginaccountsmodule0")])
-
I check the issue is in cancel state.
-
!assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue is in cancel state}:
- state == 'cancel'

View File

@ -1,32 +0,0 @@
-
Create an issue
-
!record {model: project.issue, id: project_issue_onchangeevent0}:
categ_id: project_issue.bug_categ
name: on_change event does not pass context to the method
project_id: project.project_project_22
working_hours_close: 0.0
working_hours_open: 0.0
-
Check there is no task attached to issue
-
!assert {model: project.issue, id: project_issue_onchangeevent0, string: There must not be any task attached to issue}:
- task_id.id == False
-
Convert issue to task
-
!python {model: project.issue}: |
self.convert_issue_task(cr, uid, [ref("project_issue_onchangeevent0")],
{"lang": "en_US", "project_id": False, "tz": False, "active_model": "ir.ui.menu",
"department_id": False, "section_id": False, "search_default_project_id":
False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs":
1, "active_ids": [ref("project_issue.menu_project_issue_track")], "active_id":
ref("project_issue.menu_project_issue_track"), })
-
Check there is a task attached to issue
-
!assert {model: project.issue, id: project_issue_onchangeevent0, string: After creating a task for the issue there must be a task attached to it}:
- task_id.id != False

View File

@ -0,0 +1,45 @@
Return-Path: <Robert_Adersen@yahoo.com>
X-Original-To: abc@mycompany.com
Delivered-To: abc@mycompany.com
Received: by mail1.mycompany.com (Postfix, from userid 10002)
id 3955EBFACA; Tue, 29 Nov 2011 08:14:47 +0100 (CET)
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail1.mycompany.com
X-Spam-Level:
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1
Received: from nm39-vm6.bullet.mail.ne1.yahoo.com (nm39-vm6.bullet.mail.ne1.yahoo.com [98.138.229.166])
by mail1.mycompany.com (Postfix) with SMTP id 0D074BF53A
for <abc@mycompany.com>; Tue, 29 Nov 2011 08:14:44 +0100 (CET)
Received: from [98.138.90.54] by nm39.bullet.mail.ne1.yahoo.com with NNFMP; 29 Nov 2011 07:13:26 -0000
Received: from [98.138.84.39] by tm7.bullet.mail.ne1.yahoo.com with NNFMP; 29 Nov 2011 07:13:26 -0000
Received: from [127.0.0.1] by smtp107.mail.ne1.yahoo.com with NNFMP; 29 Nov 2011 07:13:26 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.in; s=s1024; t=1322550806; bh=LFefFqrky41IufKZHP8a86obZoBPxyX1aafgWNcrw7U=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; b=NB8bd6b4Uk3/3fKhdzbcqFEZGPpKyotLeE0xh8H08rcFEahMFfY5uXgsYZsUFvTLCKfTyQWh/oPTVxHeUTGY/Y5MzAnndghX6S0mzlFtmW2dwLMqdWxQLZwU7EhbyYF9PCHicsmtlUVyo7Ou5ePSviqC0SOyCJJVWwzWlv5W9Zg=
X-Yahoo-Newman-Id: 152218.10448.bm@smtp107.mail.ne1.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: i4zQqJUVM1mab8kxoCTmgMwxw9th.MdiJzmc4Ffbno7QGkl
acotmc0pGoiw_GrhwReSA6uNIveeAUi9WA6NniWAElxbUzGIQplTBHjRhdqF
d_rLG1Yn71DYxllLCZC8xoRzumVHw.kue0ymrl4D0VO.lEeyXbbYoz.TpAvu
ZASBwSV_mESEUu96bb1esfOjI_2MhibMNmt.2egkOG6LS3AcDkVWXJb.VpQe
yZieJ5djjUx9uu4HModjROSUWHKm3Qd5ZwvG.3s1JvHNNvPC3Mo6x.DXi_rj
d70J2pruXhJ9ZnbNooZiSHkrhaugWV.kquq6475ZxKP6Tu7G8iUgZUkHWCf.
aEdBFl2.4RanSkMohEfbNtwpXUQ0eDDOOPatHFB27JSP0jw--
X-Yahoo-SMTP: oNtzSBqswBAqJIGYOgyGesyleENrhUEtEgBkQ053
Received: from [192.168.1.30] (Robert_Adersen@180.211.100.2 with plain)
by smtp107.mail.ne1.yahoo.com with SMTP; 28 Nov 2011 23:13:25 -0800 PST
Message-ID: <4ED48611.6070605@yahoo.in>
Date: Tue, 29 Nov 2011 12:43:21 +0530
From: Robert Adersen <Robert_Adersen@yahoo.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10
MIME-Version: 1.0
To: abc@mycompany.com
Subject: Error in the account module
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hello Sir,
I am using the openerp v6.1 and i have problem in hr module, so try to
check it and solve my problem.
thanks
Robert Adersen

View File

@ -0,0 +1,8 @@
-
!record {model: project.issue, id: project_task_1, view: False}:
task_id: 'project.project_task_17'
name: 'Error in account module'
-
!record {model: project.issue, id: project01, view: False}:
project_id: 'project.project_project_9'
name: 'OpenERP Integration'

View File

@ -0,0 +1,57 @@
-
In order to test process of issue tracking in OpenERP, I Open the Issue.
-
!python {model: project.issue}: |
self.case_open(cr, uid, [ref("crm_case_buginaccountsmodule0")])
-
I check state of Issue after opened it.
-
!assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in open state}:
- state == 'open'
-
Now I put Issue in pending due to need more information.
-
!python {model: project.issue}: |
self.case_pending(cr, uid, [ref("crm_case_buginaccountsmodule0")])
-
I check state after put in pending.
-
!assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in pending state}:
- state == 'pending'
-
I send mail to get more details.
-
!python {model: mail.compose.message }: |
ctx = context.copy()
ctx.update({'active_model': 'project.issue', 'active_id': ref("crm_case_buginaccountsmodule0"), 'active_ids': [ref("crm_case_buginaccountsmodule0")]})
vals = self.default_get(cr, uid , [], context=ctx)
try:
new_id = self.create(cr, uid, {'email_from': 'support@mycompany.com','email_to': 'Robert_Adersen@yahoo.com', 'subject': 'Regarding error in account module we nees more details'})
self.send_mail(cr, uid, [new_id], context=ctx)
except Exception, e:
pass
-
After getting sufficient details, I re-open Issue from pending state.
-
!python {model: project.issue}: |
self.case_open(cr, uid, [ref("crm_case_buginaccountsmodule0")])
-
I check state of Issue after re-opened.
-
!assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in open state}:
- state == 'open'
-
I create Task for Issue.
-
!python {model: project.issue}: |
self.convert_issue_task(cr, uid, [ref("crm_case_buginaccountsmodule0")])
-
I close Issue after resolving it
-
!python {model: project.issue}: |
self.case_close(cr, uid, [ref("crm_case_buginaccountsmodule0")])
-
I Check state of Issue after closed.
-
!assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in done state}:
- state == 'done'

View File

@ -0,0 +1,17 @@
-
In Order to test process of Issue in OpenERP, Custmer send the issue by email.
-
!python {model: mail.thread}: |
import addons
request_file = open(addons.get_module_resource('project_issue','test', 'issue.eml'),'rb')
request_message = request_file.read()
self.message_process(cr, uid, 'project.issue', request_message)
-
After getting the mail, I check details of new issue of that customer.
-
!python {model: project.issue}: |
issue_ids = self.search(cr, uid, [('email_from', '=', 'Robert Adersen <Robert_Adersen@yahoo.com>')])
assert issue_ids and len(issue_ids), "issue is not created after getting request"
issue = self.browse(cr, uid, issue_ids[0], context=context)
assert not issue.partner_id, "Customer should be a new"
assert issue.name == "Error in the account module", "Subject does not match"

View File

@ -1,112 +0,0 @@
-
Create an issue
-
!record {model: project.issue, id: project_issue_stockmovedates0}:
categ_id: project_issue.bug_categ
name: Stock Move dates
project_id: project.project_project_22
working_hours_close: 0.0
working_hours_open: 0.0
-
Check if issue in 'draft' state
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in draft state}:
- state == 'draft'
-
Open the issue
-
!python {model: project.issue}: |
self.case_open(cr, uid, [ref("project_issue_stockmovedates0")], {"lang":
"en_US", "active_ids": [ref("project_issue.menu_project_issue_track")], "tz":
False, "active_model": "ir.ui.menu", "search_default_project_id": False, "search_default_my_bugs":
1, "search_default_user_id": 1, "search_default_current_bugs": 1, "project_id":
False, "active_id": ref("project_issue.menu_project_issue_track"), })
-
Check if issue in 'open' state
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in open state}:
- state == 'open'
-
Keep issue pending
-
!python {model: project.issue}: |
self.case_pending(cr, uid, [ref("project_issue_stockmovedates0")],
{"lang": "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")],
"tz": False, "active_model": "ir.ui.menu", "search_default_project_id":
False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs":
1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"),
})
-
Check if issue in 'pending' state
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in pending state}:
- state == 'pending'
-
Open the issue
-
!python {model: project.issue}: |
self.case_open(cr, uid, [ref("project_issue_stockmovedates0")], {"lang":
"en_US", "active_ids": [ref("project_issue.menu_project_issue_track")], "tz":
False, "active_model": "ir.ui.menu", "search_default_project_id": False, "search_default_my_bugs":
1, "search_default_user_id": 1, "search_default_current_bugs": 1, "project_id":
False, "active_id": ref("project_issue.menu_project_issue_track"), })
-
Check if issue in 'open' state
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in open state}:
- state == 'open'
-
Cancel the issue
-
!python {model: project.issue}: |
self.case_cancel(cr, uid, [ref("project_issue_stockmovedates0")],
{"lang": "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")],
"tz": False, "active_model": "ir.ui.menu", "search_default_project_id":
False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs":
1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"),
})
-
Check if issue in 'cancel' state
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in cancel state}:
- state == 'cancel'
-
Reset the issue
-
!python {model: project.issue}: |
self.case_reset(cr, uid, [ref("project_issue_stockmovedates0")],
{"lang": "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")],
"tz": False, "active_model": "ir.ui.menu", "search_default_project_id":
False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs":
1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"),
})
-
Check if issue in 'draft' state
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in draft state}:
- state == 'draft'
-
Close the issue
-
!python {model: project.issue}: |
self.case_close(cr, uid, [ref("project_issue_stockmovedates0")],
{"lang": "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")],
"tz": False, "active_model": "ir.ui.menu", "search_default_project_id":
False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs":
1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"),
})
-
Check if issue in 'done' state
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in done state}:
- state == 'done'