Commit 13ce944f authored by Yusei Tahara's avatar Yusei Tahara

Merge branch 'master' into 'master'

A bug fix of erp5_core/Folder_delete



See merge request !65
parents 10f0a21f 10fefa8f
...@@ -150,8 +150,7 @@ elif uids:\n ...@@ -150,8 +150,7 @@ elif uids:\n
else:\n else:\n
message = Base_translateString("Please select one or more items first.")\n message = Base_translateString("Please select one or more items first.")\n
\n \n
return REQUEST.RESPONSE.redirect("%s/%s?portal_status_message=%s"\n return context.Base_redirect(form_id, keep_items={"portal_status_message":message})\n
% (context.absolute_url_path(), form_id, message))\n
]]></string> </value> ]]></string> </value>
......
...@@ -32,6 +32,7 @@ import pprint ...@@ -32,6 +32,7 @@ import pprint
import httplib import httplib
import urlparse import urlparse
import base64 import base64
import urllib
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from Testing import ZopeTestCase from Testing import ZopeTestCase
...@@ -512,7 +513,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -512,7 +513,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
self.assertEqual(0, person.getRelationCountForDeletion()) self.assertEqual(0, person.getRelationCountForDeletion())
def delete(assert_deleted, obj): def delete(assert_deleted, obj):
redirect = self._Folder_delete(obj) redirect = self._Folder_delete(obj)
self.assertTrue(('Sorry, 1 item is in use.', 'Deleted.')[assert_deleted] self.assertTrue((urllib.quote('Sorry, 1 item is in use.'), 'Deleted.')[assert_deleted]
in redirect, redirect) in redirect, redirect)
self.tic() self.tic()
delete(0, organisation) delete(0, organisation)
...@@ -541,7 +542,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -541,7 +542,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
document_1.manage_permission('View', [], acquire=0) document_1.manage_permission('View', [], acquire=0)
document_1.manage_permission('Access contents information', [], acquire=0) document_1.manage_permission('Access contents information', [], acquire=0)
redirect = self._Folder_delete(document_2) redirect = self._Folder_delete(document_2)
self.assert_('Sorry, 1 item is in use.' in redirect, redirect) self.assert_(urllib.quote('Sorry, 1 item is in use.') in redirect, redirect)
self.assertEqual(module.objectCount(), 2) self.assertEqual(module.objectCount(), 2)
def test_getPropertyForUid(self): def test_getPropertyForUid(self):
......
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