Commit 011ea48e authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_credential: move some test code to ease running tests in live

parent b102dd52
Pipeline #13644 failed with stage
in 0 seconds
......@@ -80,6 +80,13 @@ class TestERP5Credential(ERP5TypeTestCase):
system_preference = self.portal.portal_preferences.newContent(
portal_type='System Preference')
system_preference.enable()
# clear modules if necessary
module_list = (self.portal.getDefaultModule('Credential Request'),
self.portal.getDefaultModule('Credential Update'),
self.portal.getDefaultModule('Credential Recovery'),
self.portal.getDefaultModule('Person'))
for module in module_list:
module.manage_delObjects(list(module.objectIds()))
@reindex
def enableAlarm(self):
......@@ -140,14 +147,6 @@ class TestERP5Credential(ERP5TypeTestCase):
def beforeTearDown(self):
self.login()
self.abort()
# clear modules if necessary
module_list = (self.portal.getDefaultModule('Credential Request'),
self.portal.getDefaultModule('Credential Update'),
self.portal.getDefaultModule('Credential Recovery'),
self.portal.getDefaultModule('Person'))
for module in module_list:
module.manage_delObjects(list(module.objectIds()))
self.resetCredentialSystemPreference()
self.tic()
self.logout()
......@@ -779,12 +778,15 @@ class TestERP5Credential(ERP5TypeTestCase):
for line in body_message.splitlines():
match_obj = re.search(rawstr, line)
if match_obj is not None:
url = line[line.find('http:'):]
url = line[line.find('http'):]
url = url.strip()
self.assertNotEquals(url, None)
self.publish(url)
parameters = cgi.parse_qs(urlparse.urlparse(url)[4])
self.assertTrue('reset_key' in parameters)
self.assertTrue(
'reset_key' in parameters,
'reset_key not found in mail message : %s' % body_message
)
key = parameters['reset_key'][0]
# before changing, check that the user exists with 'secret' password
self._assertUserExists('barney-login', 'secret')
......
......@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testERP5Credential</string> </value>
......@@ -53,13 +59,28 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
......@@ -72,7 +93,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -81,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
......
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