Back to index

plone3  3.1.7
Public Member Functions
CMFPlone.tests.testRelatedItems.TestRelatedItems Class Reference
Inheritance diagram for CMFPlone.tests.testRelatedItems.TestRelatedItems:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testRelatedItems.TestRelatedItems:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def testRelatedItems
def testNoRelatedItems
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Detailed Description

Definition at line 8 of file testRelatedItems.py.


Member Function Documentation

Definition at line 30 of file PloneTestCase.py.

00030 
00031     def getAuthenticator(self):
00032         tag = AuthenticatorView('context', 'request').authenticator()
00033         pattern = '<input .*name="(\w+)".*value="(\w+)"'
00034         return match(pattern, tag).groups()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.PloneTestCase.PloneTestCase.setRequestMethod (   self,
  method 
) [inherited]
This is a stub now, but in case you want to try
   something fancy on Your Branch (tm), put it here.

Definition at line 26 of file PloneTestCase.py.

00026 
00027     def setRequestMethod(self, method):
00028         self.app.REQUEST.set('REQUEST_METHOD', method)
00029         self.app.REQUEST.method = method

Here is the caller graph for this function:

Definition at line 35 of file PloneTestCase.py.

00035 
00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038         self.app.REQUEST.form[name] = token
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 29 of file testRelatedItems.py.

00029 
00030     def testNoRelatedItems(self):
00031         self.folder.invokeFactory('Document', id='obj1', title='Obj1')
00032         related = self.folder.obj1.computeRelatedItems()
00033         self.assertEqual(len(related), 0)
00034 

Definition at line 10 of file testRelatedItems.py.

00010 
00011     def testRelatedItems(self):
00012         # create two objects
00013         self.folder.invokeFactory('Document', id='obj1', title='Obj1')
00014         obj1 = self.folder.obj1
00015         self.folder.invokeFactory('Document', id='obj2', title='Obj2')
00016         obj2 = self.folder.obj2
00017 
00018         # relate them
00019         obj1.setRelatedItems([obj2.UID()])
00020 
00021         # call the script for retrieving the items
00022         related = obj1.computeRelatedItems()
00023 
00024         # check length
00025         self.assertEqual(len(related), 1)
00026 
00027         # check object
00028         self.assertEqual(related[0], obj2)


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