Back to index

plone3  3.1.7
test_membership.py
Go to the documentation of this file.
00001 ##############################################################################
00002 #
00003 # PlonePAS - Adapt PluggableAuthService for use in Plone
00004 # Copyright (C) 2005 Enfold Systems, Kapil Thangavelu, et al
00005 #
00006 # This software is subject to the provisions of the Zope Public License,
00007 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this
00008 # distribution.
00009 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
00010 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00011 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
00012 # FOR A PARTICULAR PURPOSE.
00013 #
00014 ##############################################################################
00015 """
00016 """
00017 
00018 import unittest
00019 
00020 
00021 from Testing import ZopeTestCase
00022 from PlonePASTestCase import PlonePASTestCase
00023 
00024 from Products.CMFCore.utils import getToolByName
00025 
00026 class TestMemberFolder(PlonePASTestCase):
00027 
00028     def afterSetUp(self):
00029         self.mt = getToolByName(self.portal, 'portal_membership')
00030 
00031     def test_folder(self):
00032         assert self.mt.getHomeFolder() is not None
00033 
00034     def test_membershipId(self):
00035         u = self.mt.getAuthenticatedMember().getId()
00036         assert u == ZopeTestCase.user_name
00037 
00038 def test_suite():
00039     suite = unittest.TestSuite()
00040     suite.addTest(unittest.makeSuite(TestMemberFolder))
00041     return suite
00042