Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
ATContentTypes.tests.test_criteria.TestATRelativePathCriterion Class Reference
Inheritance diagram for ATContentTypes.tests.test_criteria.TestATRelativePathCriterion:
Inheritance graph
[legend]
Collaboration diagram for ATContentTypes.tests.test_criteria.TestATRelativePathCriterion:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def test_relative_path_query1
def test_relative_path_query2
def test_relative_path_query3
def test_relative_path_query4
def test_relative_path_query5
def test_relative_path_query6
def test_relative_path_query7
def test_relative_path_query8
def createDummy
def test_000testsetup
def test_multipleCreateVariants
def test_typeInfo
def test_implements
def test_Z3implements

Public Attributes

 topic
 path_crit
 dummy

Static Public Attributes

 klass = ATRelativePathCriterion
string title = 'Relative Path Criterion'
string meta_type = 'ATRelativePathCriterion'
string portal_type = 'ATRelativePathCriterion'

Detailed Description

Definition at line 604 of file test_criteria.py.


Member Function Documentation

Reimplemented from ATContentTypes.tests.test_criteria.CriteriaTest.

Definition at line 610 of file test_criteria.py.

00610 
00611     def afterSetUp(self):
00612         CriteriaTest.afterSetUp(self)
00613         self.setRoles(['Manager'])
00614         # build folder structure
00615         self.portal.invokeFactory('Folder', 'folderA')
00616         self.portal.invokeFactory('Folder', 'folderB')
00617         self.portal.folderA.invokeFactory('Folder', 'folderA1')
00618         self.portal.folderB.invokeFactory('Folder', 'folderB1')
00619         
00620         # create topic in folderA1
00621         self.portal.folderA.folderA1.invokeFactory('Topic', 'new_topic', title='New Topic')
00622         
00623         self.topic  = self.portal.folderA.folderA1.new_topic
00624         # Add a path criterion
00625         self.path_crit = self.topic.addCriterion('path', 'ATRelativePathCriterion')

Here is the call graph for this function:

def ATContentTypes.tests.test_criteria.CriteriaTest.createDummy (   self,
  klass,
  id = 'dummy' 
) [inherited]

Definition at line 72 of file test_criteria.py.

00072 
00073     def createDummy(self, klass, id='dummy'):
00074         folder = self.folder
00075         if klass is not None:
00076             dummy = klass(id, 'dummyfield')
00077             # put dummy in context of portal
00078             folder._setObject(id, dummy)
00079             dummy = getattr(folder, id)
00080             dummy.initializeArchetype()
00081         else:
00082             dummy = None
00083         return dummy

Here is the call graph for this function:

Definition at line 84 of file test_criteria.py.

00084 
00085     def test_000testsetup(self):
00086         if self.klass is not None:
00087             self.failUnless(self.klass)
00088             self.failUnless(self.portal_type)
00089             self.failUnless(self.title)
00090             self.failUnless(self.meta_type)
        

Definition at line 119 of file test_criteria.py.

00119 
00120     def test_implements(self):
00121         if self.dummy is not None:
00122             self.failIf(IReferenceable.isImplementedBy(self.dummy))
00123             self.failIf(IExtensibleMetadata.isImplementedBy(self.dummy))
00124             self.failIf(self.dummy.isReferenceable)
00125             self.failUnless(IBaseContent.isImplementedBy(self.dummy))
00126             self.failUnless(IATTopicCriterion.isImplementedBy(self.dummy))
00127             self.failUnless(verifyObject(IBaseContent, self.dummy))
00128             self.failUnless(verifyObject(IATTopicCriterion, self.dummy))

Definition at line 91 of file test_criteria.py.

00091 
00092     def test_multipleCreateVariants(self):
00093         klass = self.klass
00094         id = 'dummy'
00095         field = 'dummyfield'
00096         if klass is not None:
00097             dummy = klass(id, field)
00098             self.failUnless(dummy.getId(), id)
00099             self.failUnless(dummy.Field(), field)
00100 
00101             dummy = klass(id=id, field=field)
00102             self.failUnless(dummy.getId(), id)
00103             self.failUnless(dummy.Field(), field)
00104 
00105             dummy = klass(field, oid=id)
00106             self.failUnless(dummy.getId(), id)
00107             self.failUnless(dummy.Field(), field)
00108 
00109             dummy = klass(field=field, oid=id)
00110             self.failUnless(dummy.getId(), id)
00111             self.failUnless(dummy.Field(), field)

Definition at line 626 of file test_criteria.py.

00626 
00627     def test_relative_path_query1(self):
00628         self.path_crit.setRelativePath('..')   # should give the parent==folderA1 
00629         self.failUnless(self.path_crit.getCriteriaItems() == (('path', {'query': '/plone/folderA/folderA1', 'depth': 1}),))
        

Definition at line 630 of file test_criteria.py.

00630 
00631     def test_relative_path_query2(self):
00632         self.path_crit.setRelativePath('../..')   # should give folderA
00633         self.failUnless(self.path_crit.getCriteriaItems() == (('path', {'query': '/plone/folderA', 'depth': 1}),))
        

Definition at line 634 of file test_criteria.py.

00634 
00635     def test_relative_path_query3(self):
00636         self.path_crit.setRelativePath('../../..')   # should give the /plone (portal) 
00637         self.failUnless(self.path_crit.getCriteriaItems() == (('path', {'query': '/plone', 'depth': 1}),))
        

Definition at line 638 of file test_criteria.py.

00638 
00639     def test_relative_path_query4(self):
00640         self.path_crit.setRelativePath('../../../../../../..')   # should give the /plone (portal): cannot go higher than the portal
00641         self.failUnless(self.path_crit.getCriteriaItems() == (('path', {'query': '/plone', 'depth': 1}),))
        

Definition at line 642 of file test_criteria.py.

00642 
00643     def test_relative_path_query5(self):
00644         self.path_crit.setRelativePath('../../../folderB')   # should give folderB 
00645         self.failUnless(self.path_crit.getCriteriaItems() == (('path', {'query': '/plone/folderB', 'depth': 1}),))
        

Definition at line 646 of file test_criteria.py.

00646 
00647     def test_relative_path_query6(self):
00648         self.path_crit.setRelativePath('/folderB')   # should give folderB also (absolute paths are supported)
00649         self.failUnless(self.path_crit.getCriteriaItems() == (('path', {'query': '/plone/folderB', 'depth': 1}),))
        

Definition at line 650 of file test_criteria.py.

00650 
00651     def test_relative_path_query7(self):
00652         self.path_crit.setRelativePath('../../folderA1/../../folderB/folderB1/..')   # should give folderB 
00653         self.failUnless(self.path_crit.getCriteriaItems() == (('path', {'query': '/plone/folderB', 'depth': 1}),))

Definition at line 654 of file test_criteria.py.

00654 
00655     def test_relative_path_query8(self):
00656         self.path_crit.setRelativePath('.')   # should give the new_topic 
00657         self.failUnless(self.path_crit.getCriteriaItems() == (('path', {'query': '/plone/folderA/folderA1/new_topic', 'depth': 1}),))
00658         
00659 tests.append(TestATRelativePathCriterion)

Reimplemented in ATContentTypes.tests.test_criteria.TestATBaseCriterion.

Definition at line 112 of file test_criteria.py.

00112 
00113     def test_typeInfo(self):
00114         if self.dummy is not None:
00115             ti = self.dummy.getTypeInfo()
00116             self.failUnlessEqual(ti.getId(), self.portal_type)
00117             self.failUnlessEqual(ti.Title(), self.title)
00118             self.failUnlessEqual(ti.Metatype(), self.meta_type)
        

Definition at line 129 of file test_criteria.py.

00129 
00130     def test_Z3implements(self):
00131         if self.dummy is not None:
00132             iface = Z3IATTopicCriterion
00133             self.failUnless(Z3verifyObject(iface, self.dummy))


Member Data Documentation

Definition at line 70 of file test_criteria.py.

Reimplemented from ATContentTypes.tests.test_criteria.CriteriaTest.

Definition at line 605 of file test_criteria.py.

Reimplemented from ATContentTypes.tests.test_criteria.CriteriaTest.

Definition at line 607 of file test_criteria.py.

Definition at line 624 of file test_criteria.py.

Reimplemented from ATContentTypes.tests.test_criteria.CriteriaTest.

Definition at line 608 of file test_criteria.py.

string ATContentTypes.tests.test_criteria.TestATRelativePathCriterion.title = 'Relative Path Criterion' [static]

Reimplemented from ATContentTypes.tests.test_criteria.CriteriaTest.

Definition at line 606 of file test_criteria.py.

Definition at line 622 of file test_criteria.py.


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