Back to index

plone3  3.1.7
Public Member Functions
plone.app.portlets.tests.test_dashboard.TestDashboard Class Reference
Inheritance diagram for plone.app.portlets.tests.test_dashboard.TestDashboard:
Inheritance graph
[legend]
Collaboration diagram for plone.app.portlets.tests.test_dashboard.TestDashboard:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_default_dashboard_created_for_new_user
def test_non_ascii_usernames_created
def test_disable_dasboard_breaks_event_portlet

Detailed Description

Definition at line 16 of file test_dashboard.py.


Member Function Documentation

Definition at line 18 of file test_dashboard.py.

00018 
00019     def test_default_dashboard_created_for_new_user(self):
00020         
00021         col = getUtility(IPortletManager, name='plone.dashboard1')
00022         user_portlets = col[USER_CATEGORY]
00023         self.failIf('fakeuser' in user_portlets)
00024         
00025         # This would normally happen when a user is created
00026         notify(PrincipalCreated(PropertiedUser('fakeuser')))
00027         
00028         # We would expect some portlets to have been created after the
00029         # event handler has finished processing
00030 
00031         self.failUnless('fakeuser' in user_portlets)
00032         self.failUnless(len(user_portlets['fakeuser']) > 0)
  

Definition at line 49 of file test_dashboard.py.

00049 
00050     def test_disable_dasboard_breaks_event_portlet(self):
00051         # Bug #8230: disabling the dashboard breaks the event portlet
00052         self.portal.manage_permission('Portlets: Manage own portlets',
00053                 roles=['Manager'], acquire=0)
00054         self.loginAsPortalOwner()
00055 
00056         portlet = getUtility(IPortletType, name='portlets.Events')
00057         mapping = self.portal.restrictedTraverse('++contextportlets++plone.leftcolumn')
00058         addview = mapping.restrictedTraverse('+/' + portlet.addview)
00059         try:
00060             addview()
00061         except Unauthorized:
00062             self.fail()

Here is the call graph for this function:

Definition at line 33 of file test_dashboard.py.

00033 
00034     def test_non_ascii_usernames_created(self):
00035         user1, pass1 = u'user1\xa9'.encode('utf-8'), 'pass1'
00036         uf = self.portal.acl_users
00037         
00038         # Bug #6100 - Would throw a unicode decode error in event handler
00039         # in dashboard.py
00040         uf.userFolderAddUser(user1, pass1, ['Manager'], [])
00041 
00042         col = getUtility(IPortletManager, name='plone.dashboard1')
00043         retriever = getMultiAdapter((self.portal, col), IPortletRetriever)
00044         
00045         # Bug #7860 - Would throw a unicode decode error when fetching
00046         # portlets
00047         retriever.getPortlets()
00048    

Here is the call graph for this function:


The documentation for this class was generated from the following file: