From 502791de9ee4c606c1e4f5c93c3d0581691aa6ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Fri, 7 Sep 2007 17:11:38 +0000
Subject: [PATCH] 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
---
 product/ERP5/tests/testBase.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/product/ERP5/tests/testBase.py b/product/ERP5/tests/testBase.py
index e5432e5316..5b88eaf092 100644
--- a/product/ERP5/tests/testBase.py
+++ b/product/ERP5/tests/testBase.py
@@ -116,7 +116,7 @@ class TestBase(ERP5TypeTestCase):
       some categories for testing them
     """
     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:
         o = self.category_tool.group.newContent(portal_type='Category',
                                                 id=category_id)
@@ -983,6 +983,19 @@ class TestBase(ERP5TypeTestCase):
     obj.manage_permission('View', [], 0)
     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):
   """Tests for ERP5PropertyManager.
-- 
2.30.9