From 83b58b564d59bde57fd05449e572e92191ed806a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Tue, 19 Jul 2011 18:14:29 +0200
Subject: [PATCH] Finalise test.

ERP5Site_newCredentialRequest shall disallow to create duplicated credentials.
---
 product/ERP5/tests/testERP5Credential.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/product/ERP5/tests/testERP5Credential.py b/product/ERP5/tests/testERP5Credential.py
index 027ce12d25..aa0274e02c 100644
--- a/product/ERP5/tests/testERP5Credential.py
+++ b/product/ERP5/tests/testERP5Credential.py
@@ -1021,7 +1021,8 @@ class TestERP5Credential(ERP5TypeTestCase):
     sequence = dict(automatic_call=True)
     self.stepSetCredentialRequestAutomaticApprovalPreferences(sequence)
     self.stepSetCredentialAssignmentPropertyList()
-    self._createCredentialRequest()
+    response = self._createCredentialRequest()
+    self.assertTrue('Credential%20Request%20Created.' in response)
     portal_catalog = self.portal.portal_catalog
     credential_request = portal_catalog.getResultValue(
         portal_type="Credential Request", reference="barney")
@@ -1036,15 +1037,13 @@ class TestERP5Credential(ERP5TypeTestCase):
     self.tic()
     self.assertEqual('accepted', credential_request.getValidationState())
 
-    self._createCredentialRequest()
-    credential_request = portal_catalog.getResultValue(
-        portal_type="Credential Request", reference="barney",
-        validation_state="draft")
+    response = self._createCredentialRequest()
+    self.assertTrue('Selected%20login%20is%20already%20in%20use%2C%20pl'
+      'ease%20choose%20different%20one' in  response)
 
     self.portal.portal_alarms.accept_submitted_credentials.activeSense()
     transaction.commit()
     self.tic()
-    raise NotImplementedError('Real case is not known yet.')
     self.stepUnSetCredentialAutomaticApprovalPreferences()
 
   def testERP5Site_newCredentialRecoveryWithNoSecurityQuestion(self):
-- 
2.30.9