Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Private Member Functions
CMFDefault.tests.test_Favorite.FavoriteTests Class Reference
Inheritance diagram for CMFDefault.tests.test_Favorite.FavoriteTests:
Inheritance graph
[legend]
Collaboration diagram for CMFDefault.tests.test_Favorite.FavoriteTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def tearDown
def test_z3interfaces
def test_Empty
def test_CtorArgs
def test_edit
def test_editEmpty

Public Attributes

 site

Private Member Functions

def _getTargetClass
def _makeOne

Detailed Description

Definition at line 30 of file test_Favorite.py.


Member Function Documentation

Definition at line 32 of file test_Favorite.py.

00032 
00033     def _getTargetClass(self):
00034         from Products.CMFDefault.Favorite import Favorite
00035 
00036         return Favorite

def CMFDefault.tests.test_Favorite.FavoriteTests._makeOne (   self,
  args,
  kw 
) [private]

Definition at line 37 of file test_Favorite.py.

00037 
00038     def _makeOne(self, *args, **kw):
00039         return self._getTargetClass()(*args, **kw)

Here is the call graph for this function:

Definition at line 40 of file test_Favorite.py.

00040 
00041     def setUp(self):
00042         sm = getSiteManager()
00043         self.site = DummySite('site')
00044         sm.registerUtility(self.site, ISiteRoot)
00045         self.site._setObject( 'portal_membership', DummyTool() )
00046         self.site._setObject( 'portal_url', DummyTool() )

Definition at line 47 of file test_Favorite.py.

00047 
00048     def tearDown(self):
00049         cleanUp()

Here is the call graph for this function:

Definition at line 74 of file test_Favorite.py.

00074 
00075     def test_CtorArgs( self ):
00076         utool = self.site.portal_url
00077         self.assertEqual( self._makeOne( 'foo'
00078                                        , title='Title'
00079                                        ).Title(), 'Title' )
00080 
00081         self.assertEqual( self._makeOne( 'bar'
00082                                        , description='Description'
00083                                        ).Description(), 'Description' )
00084 
00085         baz = self.site._setObject('foo',
00086                                 self._makeOne('baz', remote_url='portal_url'))
00087         self.assertEqual( baz.getObject(), utool )
00088         self.assertEqual( baz.getRemoteUrl()
00089                         , '%s/portal_url' % utool.root )
00090         self.assertEqual( baz.getIcon(), utool.getIcon() )

Definition at line 91 of file test_Favorite.py.

00091 
00092     def test_edit( self ):
00093         utool = self.site.portal_url
00094         f = self.site._setObject('foo', self._makeOne('foo'))
00095         f.edit( 'portal_url' )
00096         self.assertEqual( f.getObject(), utool )
00097         self.assertEqual( f.getRemoteUrl()
00098                         , '%s/portal_url' % utool.root )
00099         self.assertEqual( f.getIcon(), utool.getIcon() )

Definition at line 100 of file test_Favorite.py.

00100 
00101     def test_editEmpty( self ):
00102         utool = self.site.portal_url
00103         f = self.site._setObject('gnnn', self._makeOne('gnnn'))
00104         f.edit( '' )
00105         self.assertEqual( f.getObject(), self.site )
00106         self.assertEqual( f.getRemoteUrl(), utool.root )
00107         self.assertEqual( f.getIcon(), self.site.getIcon() )
00108 

Definition at line 62 of file test_Favorite.py.

00062 
00063     def test_Empty( self ):
00064         utool = self.site.portal_url
00065         f = self.site._setObject('foo', self._makeOne('foo'))
00066 
00067         self.assertEqual( f.getId(), 'foo' )
00068         self.assertEqual( f.Title(), '' )
00069         self.assertEqual( f.Description(), '' )
00070         self.assertEqual( f.getRemoteUrl(), utool.root )
00071         self.assertEqual( f.getObject(), self.site )
00072         self.assertEqual( f.getIcon(), self.site.getIcon() )
00073         self.assertEqual( f.getIcon(1), self.site.getIcon(1) )

Definition at line 50 of file test_Favorite.py.

00050 
00051     def test_z3interfaces(self):
00052         from zope.interface.verify import verifyClass
00053         from Products.CMFDefault.interfaces import IFavorite
00054         from Products.CMFDefault.interfaces import ILink
00055         from Products.CMFDefault.interfaces import IMutableFavorite
00056         from Products.CMFDefault.interfaces import IMutableLink
00057 
00058         verifyClass(IFavorite, self._getTargetClass())
00059         verifyClass(ILink, self._getTargetClass())
00060         verifyClass(IMutableFavorite, self._getTargetClass())
00061         verifyClass(IMutableLink, self._getTargetClass())

Here is the call graph for this function:


Member Data Documentation

Definition at line 42 of file test_Favorite.py.


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