Commit cbc67a82 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* role information for Person, Assignment, and Bug were missing. the test...

* role information for Person, Assignment, and Bug were missing. the test looked working fine because self.login('dummy') meant loging in with manager account before.
* now a sender of a bug notification should be its owner.
* no need to add Manager role for 'dummy' user.
* use 'dummy' user in test_03_setCheckBugNotification too.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30220 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ad37a5fb
...@@ -44,7 +44,9 @@ class TestBug(ERP5TypeTestCase): ...@@ -44,7 +44,9 @@ class TestBug(ERP5TypeTestCase):
RUN_ALL_TEST = 1 RUN_ALL_TEST = 1
QUIET = 1 QUIET = 1
person_portal_type = "Person" person_portal_type = "Person"
assignment_portal_type = "Assignment"
project_portal_type = "Project" project_portal_type = "Project"
bug_portal_type = "Bug"
organisation_portal_type = "Organisation" organisation_portal_type = "Organisation"
def getTitle(self): def getTitle(self):
...@@ -114,19 +116,21 @@ class TestBug(ERP5TypeTestCase): ...@@ -114,19 +116,21 @@ class TestBug(ERP5TypeTestCase):
assignment.open() assignment.open()
transaction.commit() transaction.commit()
self.tic() self.tic()
module_list = []
portal_type_list = [] portal_type_list = []
for portal_type in (self.project_portal_type, for portal_type in (self.project_portal_type,
self.bug_portal_type,
self.person_portal_type,
self.assignment_portal_type,
self.organisation_portal_type,): self.organisation_portal_type,):
module = portal.getDefaultModule(portal_type)
module_list.append(module)
portal_type_list.append(portal_type) portal_type_list.append(portal_type)
module = portal.getDefaultModule(portal_type, None)
if module is not None:
portal_type_list.append(module.getPortalType()) portal_type_list.append(module.getPortalType())
for portal_type in portal_type_list: for portal_type in portal_type_list:
ti = portal.portal_types[portal_type] ti = portal.portal_types[portal_type]
ti.newContent(portal_type='Role Information', ti.newContent(portal_type='Role Information',
role_name_list=('Auditor','Author','Assignee','Assignor','Manager'), role_name_list=('Auditor','Author','Assignee','Assignor'),
title='Dummy', title='Dummy',
role_base_category_script_id= role_base_category_script_id=
'ERP5Type_getSecurityCategoryFromAssignment', 'ERP5Type_getSecurityCategoryFromAssignment',
...@@ -200,7 +204,7 @@ class TestBug(ERP5TypeTestCase): ...@@ -200,7 +204,7 @@ class TestBug(ERP5TypeTestCase):
last_message = self.portal.MailHost._last_message last_message = self.portal.MailHost._last_message
self.assertNotEquals((), last_message) self.assertNotEquals((), last_message)
mfrom, mto, messageText = last_message mfrom, mto, messageText = last_message
self.assertEquals('Portal Administrator <postmaster@localhost>', mfrom) self.assertEquals('"dummy" <loggedperson@localhost>', mfrom)
self.assertEquals(['person1@localhost'], mto) self.assertEquals(['person1@localhost'], mto)
self.failUnless(bug.getTitle().replace(" ", "_") in messageText) self.failUnless(bug.getTitle().replace(" ", "_") in messageText)
...@@ -450,7 +454,8 @@ class TestBug(ERP5TypeTestCase): ...@@ -450,7 +454,8 @@ class TestBug(ERP5TypeTestCase):
""" """
if not run: return if not run: return
sequence_list = SequenceList() sequence_list = SequenceList()
step_list = [ 'stepCreateBug' step_list = [ 'stepLoginUsualUser'
, 'stepCreateBug'
, 'stepCreateProject' , 'stepCreateProject'
, 'stepCreatePerson1' , 'stepCreatePerson1'
, 'stepCreatePerson2' , 'stepCreatePerson2'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment