[Zope-CMF] Re: What is a member?

2005-06-30 Thread Tom Dossis


http://mail.zope.org/pipermail/zope-cmf/2003-November/019794.html

> Florent Guillaume wrote:
>> What is it really to be a member of a portal ?
>>
>> 1) we have the Member role, but nowhere is it enforced that members 
must be Member.

>
> members represent users that are allowed to login to the portal and 
use features of the site that are not public. They might have different 
global or local Roles.

>
> The 'Member' Role represents a basic set of Permissions common 
members have for the site. Sometimes this Role represents the least 
common denominator and all members have the 'Member' Role. In other 
cases members with Roles like 'Reviewer' or 'Manager' don't have a 
'Member' Role. I would not enforce one policy.



That's pretty subtle.

I've added a third party role, 'Customer' to my CMF site.  I don't want 
this role to 'add portal content'.  I have member folder auto creation 
'on' for my standard 'Members'.  But this means my Customer's also have 
a folder object created for them - which I don't want.


Is it simply a case of 'patch' my CMF MembershipTool to only do this
 if user.has_role('Member') ... ?

Or should I be looking at it from a different perspective?

Regards
-Tom
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] Testing skin scripts and templates using ZopeTestCase.Functional

2005-10-05 Thread Tom Dossis

Paul Winkler wrote:

Hi again :)
I'm trying to use CMFTestCase along with ZopeTestCase.Functional
to test my skin scripts.  But how do I get them set up
properly? Anybody have working examples of this?  I wondered
if there might be some in the Plone test suites but if so I
didn't find any.

Example that fails because "document_view" is 404:

class TestUI(CMFTestCase.CMFTestCase,
 ZopeTestCase.FunctionalTestCase,
 ):

"""Test the skin scripts and templates.
"""

def getPortal(self):
# Set up a CMF site.
setupCMFSite(app=self.app)
return getattr(self.app, CMFTestCase.portal_name)

def afterSetUp(self):
self.basic_auth = '%s:%s' % (user_name, user_password)
self.setRoles(['Manager', 'Member'])
# Add a folder and a doc.
self.portal.invokeFactory(type_name='Folder', id='folder1')
self.fol1 = self.portal.folder1
data = 'Testing ZSyncer Tool, blah blah blah'
self.fol1.invokeFactory('Document', 'test_doc1',
title='nunya bizness',
text=data)
self.doc1 = self.fol1.test_doc1

def test_DocView(self):
url = self.doc1.absolute_url_path()
import pdb; pdb.set_trace()
response = self.publish(url, self.basic_auth)


Some stepping around with pdb reveals this:

(Pdb) n

/zope/ZopeSoftwareHome/lib/python/ZPublisher/Publish.py(101)publish()

-> request, bind=1)
(Pdb) n
NotFound: 'document_view'



Maybe adding the following in afterSetUp() will help.

self._refreshSkinData()


-Tom
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests