Commit 502791de authored by Jérome Perrin's avatar Jérome Perrin

add a test to download a File as Member


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16165 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9cf141c2
...@@ -116,7 +116,7 @@ class TestBase(ERP5TypeTestCase): ...@@ -116,7 +116,7 @@ class TestBase(ERP5TypeTestCase):
some categories for testing them some categories for testing them
""" """
category_list = ['testGroup1', 'testGroup2'] category_list = ['testGroup1', 'testGroup2']
if len(self.category_tool.group.contentValues()) == 0 : if 'testGroup1' not in self.category_tool.group.contentIds():
for category_id in category_list: for category_id in category_list:
o = self.category_tool.group.newContent(portal_type='Category', o = self.category_tool.group.newContent(portal_type='Category',
id=category_id) id=category_id)
...@@ -983,6 +983,19 @@ class TestBase(ERP5TypeTestCase): ...@@ -983,6 +983,19 @@ class TestBase(ERP5TypeTestCase):
obj.manage_permission('View', [], 0) obj.manage_permission('View', [], 0)
self.assertEquals(None, obj.getViewPermissionOwner()) self.assertEquals(None, obj.getViewPermissionOwner())
def test_Member_Base_download(self):
# tests that members can download files
f = self.portal.newContent(portal_type='File', id='f')
# login as a member
uf = self.portal.acl_users
uf._doAddUser('member_user', 'secret', ['Member'], [])
user = uf.getUserById('member_user').__of__(uf)
newSecurityManager(None, user)
f.Base_download()
# if it didn't raise Unauthorized, Ok
class TestERP5PropertyManager(unittest.TestCase): class TestERP5PropertyManager(unittest.TestCase):
"""Tests for ERP5PropertyManager. """Tests for ERP5PropertyManager.
......
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