Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
wicked.at.tests.test_linking.TestWikiLinking Class Reference
Inheritance diagram for wicked.at.tests.test_linking.TestWikiLinking:
Inheritance graph
[legend]
Collaboration diagram for wicked.at.tests.test_linking.TestWikiLinking:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def test_backlink
def testforlink
def testformultiplelinks
def testInexactTitleNotMatch
def testInexactTitleNotBlockLocalId
def testInexactLocalTitleNotBlockLocalTitle
def testInexactRemoteTitleNotBlockRemoteId
def testInexactRemoteTitleNotBlockRemoteTitle
def testDupLocalTitleMatchesOldest
def testDupRemoteIdMatchesOldest
def makeFolders
def testDupRemoteTitleMatchesOldest
def testLinkPersistsThroughMove
def replaceCreatedIndex
def demoCreate
def moveContent

Static Public Attributes

string wicked_type = 'IronicWiki'
string wicked_field = 'body'

Detailed Description

Definition at line 35 of file test_linking.py.


Member Function Documentation

Definition at line 37 of file test_linking.py.

00037 
00038     def afterSetUp(self):
00039         super(TestWikiLinking, self).afterSetUp()
00040         self.set_text(self.page1, '((%s))' % TITLE2)

Here is the call graph for this function:

def wicked.at.tests.test_linking.Base.demoCreate (   self,
  kw 
) [inherited]

Definition at line 24 of file test_linking.py.

00024 
00025     def demoCreate(self, **kw):
00026         self.login('test_user_1_')
00027         addview = self.page1.restrictedTraverse('@@wickedadd')
00028         addview.add_content(title=self.title, section=self.wicked_field, type_name=self.wicked_type)

Here is the call graph for this function:

Definition at line 143 of file test_linking.py.

00143 
00144     def makeFolders(self, *args):
00145         folders = list()
00146         for id in args:
00147             folders.append(makeContent(self.folder, id, 'Folder'))
00148         return tuple(folders)
            

Here is the call graph for this function:

Here is the caller graph for this function:

def wicked.at.tests.test_linking.Base.moveContent (   self,
  obj,
  target 
) [inherited]

Definition at line 29 of file test_linking.py.

00029 
00030     def moveContent(self, obj, target):
00031         cps = obj.aq_parent.manage_copyObjects([obj.getId()])
00032         target.manage_pasteObjects(cps)
00033 
00034 

Here is the caller graph for this function:

replace the 'created' index w/ a field index b/c we need
better than 1 minute resolution for our testing 

Definition at line 15 of file test_linking.py.

00015 
00016     def replaceCreatedIndex(self):
00017         """ replace the 'created' index w/ a field index b/c we need
00018         better than 1 minute resolution for our testing """
00019         cat = getToolByName(self.portal, 'portal_catalog')
00020         cat.delIndex('created')
00021         cat.manage_addIndex('created', 'FieldIndex',
00022                             extra={'indexed_attrs':'created'})
00023         cat.manage_reindexIndex(ids=['created'])
    

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 41 of file test_linking.py.

00041 
00042     def test_backlink(self):
00043         assert self.page1 in self.page2.getRefs(relationship=BACKLINK_RELATIONSHIP)

Definition at line 102 of file test_linking.py.

00102 
00103     def testDupLocalTitleMatchesOldest(self):
00104         self.replaceCreatedIndex()
00105         title = 'Duplicate Title'
00106         w1 = makeContent(self.folder, 'w1', self.wicked_type,
00107                          title=title)
00108         w2 = makeContent(self.folder, 'w2', self.wicked_type,
00109                          title=title)
00110         w3 = makeContent(self.folder, 'w3', self.wicked_type,
00111                          title=title)
00112         self.set_text(self.page1, "((%s))" % title)
00113         self.failUnlessWickedLink(self.page1, w1)
00114 
00115         # this also tests that deleting uncaches
00116         self.folder.manage_delObjects(ids=[w1.getId()])
00117 
00118         self.failUnlessWickedLink(self.page1, w2)

Here is the call graph for this function:

Definition at line 119 of file test_linking.py.

00119 
00120     def testDupRemoteIdMatchesOldest(self):
00121         self.replaceCreatedIndex()
00122         id = 'duplicate_id'
00123         f2 = makeContent(self.folder, 'f2', 'Folder')
00124         f3 = makeContent(self.folder, 'f3', 'Folder')
00125         f4 = makeContent(self.folder, 'f4', 'Folder')
00126         w1 = makeContent(f2, id, self.wicked_type,
00127                          title='W1 Title')
00128         # mix up the order, just to make sure
00129         w3 = makeContent(f4, id, self.wicked_type,
00130                          title='W3 Title')
00131         w2 = makeContent(f3, id, self.wicked_type,
00132                          title='W2 Title')
00133         self.set_text(self.page1, "((%s))" % id)
00134         self.failIfWickedLink(self.page1, w2)
00135         self.failIfWickedLink(self.page1, w3)
00136         self.failUnlessWickedLink(self.page1, w1)
00137 
00138         f2.manage_delObjects(ids=[w1.id])
00139         self.failIfWickedLink(self.page1, w2)
00140 
00141         # fails due to caching
00142         self.failUnlessWickedLink(self.page1, w3)

Here is the call graph for this function:

Definition at line 149 of file test_linking.py.

00149 
00150     def testDupRemoteTitleMatchesOldest(self):
00151         self.replaceCreatedIndex()
00152         title = 'Duplicate Title'
00153         
00154         f2, f3, f4 = self.makeFolders('f2', 'f3', 'f4')
00155 
00156         w1 = makeContent(f2, 'w1', self.wicked_type,
00157                          title=title)
00158         # mix up the order, just to make sure
00159         w3 = makeContent(f4, 'w3', self.wicked_type,
00160                          title=title)
00161         w2 = makeContent(f3, 'w2', self.wicked_type,
00162                          title=title)
00163         self.set_text(self.page1, "((%s))" % title)
00164         self.failUnlessWickedLink(self.page1, w1)
00165         self.failIfWickedLink(self.page1, w2)
00166         self.failIfWickedLink(self.page1, w3)
00167 
00168         f2.manage_delObjects(ids=[w1.id])
00169         self.failUnlessWickedLink(self.page1, w3)
00170         self.failIfWickedLink(self.page1, w2)

Here is the call graph for this function:

Definition at line 44 of file test_linking.py.

00044 
00045     def testforlink(self):
00046         self.failUnlessWickedLink(self.page1, self.page2)

Here is the call graph for this function:

Definition at line 47 of file test_linking.py.

00047 
00048     def testformultiplelinks(self):
00049         self.set_text(self.page1, '((DMV Computer has died))  ((Make another link))')
00050         self.failUnlessAddLink(self.page1)
00051                         
00052         self.failUnlessWickedLink(self.page1, self.page2)
        

Here is the call graph for this function:

Definition at line 69 of file test_linking.py.

00069 
00070     def testInexactLocalTitleNotBlockLocalTitle(self):
00071         w1 = makeContent(self.folder, 'w1', self.wicked_type,
00072                          title='W1 Title')
00073         w2 = makeContent(self.folder, 'w2', self.wicked_type,
00074                          title='%s With Extra' % w1.Title())
00075         self.set_text(self.page1, "((%s))" % w1.Title())
00076         self.failUnlessWickedLink(self.page1, w1)
00077         self.failIfWickedLink(self.page1, w2)

Here is the call graph for this function:

Definition at line 78 of file test_linking.py.

00078 
00079     def testInexactRemoteTitleNotBlockRemoteId(self):
00080         f2 = makeContent(self.folder, 'f2', 'Folder')
00081         w1 = makeContent(self.folder, 'w1', self.wicked_type,
00082                          title='W1 Title')
00083         w2 = makeContent(self.folder, 'w2', self.wicked_type,
00084                          title='%s With Extra' % w1.id)
00085         w3 = makeContent(f2, 'w3', self.wicked_type,
00086                          title='W3 Title')
00087         self.set_text(w3, "((%s))" % w1.id)
00088         self.failUnlessWickedLink(w3, w1)
00089         self.failIfWickedLink(w3, w2)

Here is the call graph for this function:

Definition at line 90 of file test_linking.py.

00090 
00091     def testInexactRemoteTitleNotBlockRemoteTitle(self):
00092         f2 = makeContent(self.folder, 'f2', 'Folder')
00093         w1 = makeContent(self.folder, 'w1', self.wicked_type,
00094                          title='W1 Title')
00095         w2 = makeContent(self.folder, 'w2', self.wicked_type,
00096                          title='%s With Extra' % w1.Title())
00097         w3 = makeContent(f2, 'w3', self.wicked_type,
00098                          title='W3 Title')
00099         self.set_text(w3, "((%s))" % w1.Title())
00100         self.failUnlessWickedLink(w3, w1)
00101         self.failIfWickedLink(w3, w2)

Here is the call graph for this function:

Definition at line 60 of file test_linking.py.

00060 
00061     def testInexactTitleNotBlockLocalId(self):
00062         w1 = makeContent(self.folder, 'w1', self.wicked_type,
00063                          title='W1 Title')
00064         w2 = makeContent(self.folder, 'w2', self.wicked_type,
00065                          title='%s With Extra' % w1.id)
00066         self.set_text(self.page1, "((%s))" % w1.id)
00067         self.failUnlessWickedLink(self.page1, w1)
00068         self.failIfWickedLink(self.page1, w2)

Here is the call graph for this function:

Definition at line 53 of file test_linking.py.

00053 
00054     def testInexactTitleNotMatch(self):
00055         w1 = makeContent(self.folder, 'w1', self.wicked_type,
00056                          title='W1 Title With Extra')
00057         self.set_text(self.page1, "((W1 Title))")
00058         self.failIfWickedLink(self.page1, w1)
00059         self.failUnlessAddLink(self.page1)

Here is the call graph for this function:

Definition at line 171 of file test_linking.py.

00171 
00172     def testLinkPersistsThroughMove(self):
00173         title = 'Move Me'
00174         f2, f3 = self.makeFolders('f2', 'f3')
00175         w1 = makeContent(f2, 'w1', self.wicked_type,
00176                          title=title)
00177         
00178         # check implicit resolution
00179         # this is a pre-test
00180         # should set cache
00181         self.set_text(self.page1, "((%s))" % title)
00182         self.failUnlessWickedLink(self.page1, w1)
00183 
00184         # move w1
00185         self.moveContent(w1, f3)
00186 
00187         w1.setTitle('new title to make sure we do not accidentally resolve')
00188         
00189         # check link did not change
00190         self.failUnlessWickedLink(self.page1, w1)

Here is the call graph for this function:


Member Data Documentation

string wicked.at.tests.test_linking.Base.wicked_field = 'body' [static, inherited]

Definition at line 13 of file test_linking.py.

string wicked.at.tests.test_linking.Base.wicked_type = 'IronicWiki' [static, inherited]

Definition at line 12 of file test_linking.py.


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