Commit e3624f0f authored by Łukasz Nowak's avatar Łukasz Nowak

Cover a bug.

When person will register to vifib in order to add his own computer and request
instance there will be incorrectly configured Sale Packing List.
parent 14518bd5
...@@ -1523,6 +1523,84 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin): ...@@ -1523,6 +1523,84 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def test_bug_person_request_ComputerPartition_own_computer(self):
"""Checks that Person using Slap interface is able to request Computer
Partition"""
self.computer_partition_amount = 1
sequence_list = SequenceList()
sequence_string = self.prepare_published_software_release + \
"""
Logout
RequestCredentialFromWebSite
Tic
LoginDefaultUser
SubmitCredentialRequest
Tic
AcceptSubmittedCredentialsActiveSense
Tic
Logout
LoginWebUser
CustomerRegisterNewComputer
Tic
SetComputerCoordinatesFromComputerTitle
ComputerSetAllocationScopeOpenPersonal
Logout
SlapLoginCurrentComputer
FormatComputer
Tic
SlapLogout
LoginWebUser
RequestSoftwareInstallation
Tic
Logout
SlapLoginCurrentComputer
ComputerSoftwareReleaseAvailable
Tic
SlapLogout
SetRandomRequestedReference
SlapLoginWebUser
PersonRequestSlapSoftwareInstancePrepare
Tic
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
Logout
SlapLoginWebUser
PersonRequestSlapSoftwareInstance
Tic
SlapLogout
LoginDefaultUser
SetCurrentPersonSlapRequestedSoftwareInstance
CheckPersonRequestedSoftwareInstanceAndRelatedComputerPartition
Logout
SlapLoginCurrentSoftwareInstance
CheckRequestedComputerPartitionCleanParameterList
SlapLogout
LoginWebUser
CheckViewCurrentSoftwareInstance
CheckWriteCurrentSoftwareInstance
Tic
Logout
LoginERP5TypeTestCase
CheckSiteConsistency
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVifibSlapBug)) suite.addTest(unittest.makeSuite(TestVifibSlapBug))
......
...@@ -873,6 +873,10 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -873,6 +873,10 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
global REMOTE_USER global REMOTE_USER
REMOTE_USER = 'test_vifib_customer' REMOTE_USER = 'test_vifib_customer'
def stepSlapLoginWebUser(self, sequence, **kw):
global REMOTE_USER
REMOTE_USER = sequence['web_user']
######################################## ########################################
# Typical sequences for scenarios # Typical sequences for scenarios
######################################## ########################################
...@@ -3949,6 +3953,32 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -3949,6 +3953,32 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
sequence.edit(software_instance_uid=root_software_instance.getUid(), sequence.edit(software_instance_uid=root_software_instance.getUid(),
computer_partition_reference=computer_partition_reference) computer_partition_reference=computer_partition_reference)
def stepRequestCredentialFromWebSite(self, sequence, **kw):
sequence['web_user_email'] = '%s@example.com' % random()
sequence['web_user'] = '%s.%s' % (self.id(), random())
self.portal.ERP5Site_newCredentialRequest(\
first_name='Homer',
last_name='Simpson',
reference=sequence['web_user'],
password='secret',
default_email_text=sequence['web_user_email'],
)
def stepSubmitCredentialRequest(self, sequence, **kw):
"""Simulates click of user in email confirmation about account"""
credential_request = self.portal.portal_catalog.getResultValue(
portal_type='Credential Request',
reference=sequence['web_user']
)
credential_request.submit()
def stepAcceptSubmittedCredentialsActiveSense(self, **kw):
self.portal.portal_alarms.accept_submitted_credentials.activeSense()
def stepLoginWebUser(self, sequence, **kw):
self.login(sequence['web_user'])
class TestVifibSlapWebService(TestVifibSlapWebServiceMixin): class TestVifibSlapWebService(TestVifibSlapWebServiceMixin):
######################################## ########################################
# slap.initializeConnection # slap.initializeConnection
...@@ -4191,31 +4221,6 @@ class TestVifibSlapWebService(TestVifibSlapWebServiceMixin): ...@@ -4191,31 +4221,6 @@ class TestVifibSlapWebService(TestVifibSlapWebServiceMixin):
# Other tests # Other tests
######################################## ########################################
def stepRequestCredentialFromWebSite(self, sequence, **kw):
sequence['web_user_email'] = '%s@example.com' % random()
sequence['web_user'] = '%s.%s' % (self.id(), random())
self.portal.ERP5Site_newCredentialRequest(\
first_name='Homer',
last_name='Simpson',
reference=sequence['web_user'],
password='secret',
default_email_text=sequence['web_user_email'],
)
def stepSubmitCredentialRequest(self, sequence, **kw):
"""Simulates click of user in email confirmation about account"""
credential_request = self.portal.portal_catalog.getResultValue(
portal_type='Credential Request',
reference=sequence['web_user']
)
credential_request.submit()
def stepAcceptSubmittedCredentialsActiveSense(self, **kw):
self.portal.portal_alarms.accept_submitted_credentials.activeSense()
def stepLoginWebUser(self, sequence, **kw):
self.login(sequence['web_user'])
def test_person_from_credential_request_software_instance(self): def test_person_from_credential_request_software_instance(self):
"""Checks that person created from web can use the system""" """Checks that person created from web can use the system"""
sequence_list = SequenceList() sequence_list = SequenceList()
......
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