Back to index

plone3  3.1.7
Public Member Functions
plone.app.redirector.tests.test_events.TestRedirectorEvents Class Reference
Inheritance diagram for plone.app.redirector.tests.test_events.TestRedirectorEvents:
Inheritance graph
[legend]
Collaboration diagram for plone.app.redirector.tests.test_events.TestRedirectorEvents:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def storage
def test_rename_updates_storage
def test_cut_paste_updates_storage
def test_cut_paste_rename_updates_storage
def test_delete_destroys_reference
def test_delete_destroys_child_reference
def test_rename_updates_parent_and_children
def test_cut_paste_updates_parent_and_children
def test_rename_updates_parent_and_children_deep
def test_cut_paste_updates_parent_and_children_deep
def test_add_doesnt_create_storage_entry

Detailed Description

Ensure that the redirector event subscribers behave as expected.

Definition at line 9 of file test_events.py.


Member Function Documentation

Definition at line 14 of file test_events.py.

00014 
00015     def storage(self):
00016         return getUtility(IRedirectionStorage)

Here is the caller graph for this function:

refers https://dev.plone.org/plone/ticket/8260 

Definition at line 135 of file test_events.py.

00135 
00136     def test_add_doesnt_create_storage_entry(self):
00137         """ refers https://dev.plone.org/plone/ticket/8260 """
00138         self.assertEqual(list(self.storage), [])
00139         self.folder.invokeFactory('Document', 'p1')
00140         transaction.savepoint(1)
00141         self.assertEqual(list(self.storage), [])
00142 

Here is the call graph for this function:

Definition at line 37 of file test_events.py.

00037 
00038     def test_cut_paste_rename_updates_storage(self):
00039         self.folder.invokeFactory('Folder', 'f1')
00040         self.folder.invokeFactory('Document', 'p1')
00041         self.folder.invokeFactory('Document', 'p2')
00042         transaction.savepoint(1)
00043         cp = self.folder.manage_cutObjects(ids=('p1', 'p2',))
00044         self.folder.f1.manage_pasteObjects(cp)
00045         transaction.savepoint(1)
00046         self.folder.f1.manage_renameObject('p2', 'p3')
00047 
00048         fp = '/'.join(self.folder.getPhysicalPath())
00049         self.assertEquals(self.storage.get(fp + '/p1'), fp + '/f1/p1')
00050         self.assertEquals(self.storage.get(fp + '/p2'), fp + '/f1/p3')
00051         self.assertEquals(self.storage.get(fp + '/f1/p2'), fp + '/f1/p3')

Definition at line 91 of file test_events.py.

00091 
00092     def test_cut_paste_updates_parent_and_children(self):
00093         self.folder.invokeFactory('Folder', 'f1')
00094         self.folder.invokeFactory('Folder', 'f2')
00095         self.folder.f1.invokeFactory('Document', 'p1')
00096         self.folder.f1.invokeFactory('Document', 'p2')
00097         transaction.savepoint(1)
00098         cp = self.folder.manage_cutObjects(ids=('f1',))
00099         self.folder.f2.manage_pasteObjects(cp)
00100 
00101         fp = '/'.join(self.folder.getPhysicalPath())
00102         self.assertEquals(self.storage.get(fp + '/f1'), fp + '/f2/f1')
00103         self.assertEquals(self.storage.get(fp + '/f1/p1'), fp + '/f2/f1/p1')
00104         self.assertEquals(self.storage.get(fp + '/f1/p2'), fp + '/f2/f1/p2')

Definition at line 119 of file test_events.py.

00119 
00120     def test_cut_paste_updates_parent_and_children_deep(self):
00121         self.folder.invokeFactory('Folder', 'f1')
00122         self.folder.invokeFactory('Folder', 'f2a')
00123         self.folder.f1.invokeFactory('Folder', 'f11')
00124         self.folder.f1.f11.invokeFactory('Document', 'p1')
00125         self.folder.f1.f11.invokeFactory('Document', 'p2')
00126         transaction.savepoint(1)
00127         cp = self.folder.manage_cutObjects(ids=('f1',))
00128         self.folder.f2a.manage_pasteObjects(cp)
00129 
00130         fp = '/'.join(self.folder.getPhysicalPath())
00131         self.assertEquals(self.storage.get(fp + '/f1'), fp + '/f2a/f1')
00132         self.assertEquals(self.storage.get(fp + '/f1/f11'), fp + '/f2a/f1/f11')
00133         self.assertEquals(self.storage.get(fp + '/f1/f11/p1'), fp + '/f2a/f1/f11/p1')
00134         self.assertEquals(self.storage.get(fp + '/f1/f11/p2'), fp + '/f2a/f1/f11/p2')

Definition at line 25 of file test_events.py.

00025 
00026     def test_cut_paste_updates_storage(self):
00027         self.folder.invokeFactory('Folder', 'f1')
00028         self.folder.invokeFactory('Document', 'p1')
00029         self.folder.invokeFactory('Document', 'p2')
00030         transaction.savepoint(1)
00031         cp = self.folder.manage_cutObjects(ids=('p1', 'p2',))
00032         self.folder.f1.manage_pasteObjects(cp)
00033 
00034         fp = '/'.join(self.folder.getPhysicalPath())
00035         self.assertEquals(self.storage.get(fp + '/p1'), fp + '/f1/p1')
00036         self.assertEquals(self.storage.get(fp + '/p2'), fp + '/f1/p2')

Definition at line 65 of file test_events.py.

00065 
00066     def test_delete_destroys_child_reference(self):
00067         self.folder.invokeFactory('Folder', 'f1')
00068         self.folder.f1.invokeFactory('Document', 'p1')
00069         transaction.savepoint(1)
00070         self.folder.f1.manage_renameObject('p1', 'p2')
00071         transaction.savepoint(1)
00072 
00073         fp = '/'.join(self.folder.getPhysicalPath())
00074         self.assertEquals(self.storage.get(fp + '/f1/p1'), fp + '/f1/p2')
00075 
00076         self.folder._delObject('f1')
00077 
00078         self.assertEquals(self.storage.get(fp + '/f1/p1'), None)

Definition at line 52 of file test_events.py.

00052 
00053     def test_delete_destroys_reference(self):
00054         self.folder.invokeFactory('Document', 'p1')
00055         transaction.savepoint(1)
00056         self.folder.manage_renameObject('p1', 'p2')
00057         transaction.savepoint(1)
00058 
00059         fp = '/'.join(self.folder.getPhysicalPath())
00060         self.assertEquals(self.storage.get(fp + '/p1'), fp + '/p2')
00061 
00062         self.folder._delObject('p2')
00063 
00064         self.assertEquals(self.storage.get(fp + '/p1'), None)

Definition at line 79 of file test_events.py.

00079 
00080     def test_rename_updates_parent_and_children(self):
00081         self.folder.invokeFactory('Folder', 'f1')
00082         self.folder.f1.invokeFactory('Document', 'p1')
00083         self.folder.f1.invokeFactory('Document', 'p2')
00084         transaction.savepoint(1)
00085         self.folder.manage_renameObject('f1', 'f2')
00086 
00087         fp = '/'.join(self.folder.getPhysicalPath())
00088         self.assertEquals(self.storage.get(fp + '/f1'), fp + '/f2')
00089         self.assertEquals(self.storage.get(fp + '/f1/p1'), fp + '/f2/p1')
00090         self.assertEquals(self.storage.get(fp + '/f1/p2'), fp + '/f2/p2')

Definition at line 105 of file test_events.py.

00105 
00106     def test_rename_updates_parent_and_children_deep(self):
00107         self.folder.invokeFactory('Folder', 'f1')
00108         self.folder.f1.invokeFactory('Folder', 'f11')
00109         self.folder.f1.f11.invokeFactory('Document', 'p1')
00110         self.folder.f1.f11.invokeFactory('Document', 'p2')
00111         transaction.savepoint(1)
00112         self.folder.manage_renameObject('f1', 'f2a')
00113 
00114         fp = '/'.join(self.folder.getPhysicalPath())
00115         self.assertEquals(self.storage.get(fp + '/f1'), fp + '/f2a')
00116         self.assertEquals(self.storage.get(fp + '/f1/f11'), fp + '/f2a/f11')
00117         self.assertEquals(self.storage.get(fp + '/f1/f11/p1'), fp + '/f2a/f11/p1')
00118         self.assertEquals(self.storage.get(fp + '/f1/f11/p2'), fp + '/f2a/f11/p2')

Definition at line 17 of file test_events.py.

00017 
00018     def test_rename_updates_storage(self):
00019         self.folder.invokeFactory('Document', 'p1')
00020         transaction.savepoint(1)
00021         self.folder.manage_renameObject('p1', 'p2')
00022 
00023         fp = '/'.join(self.folder.getPhysicalPath())
00024         self.assertEquals(self.storage.get(fp + '/p1'), fp + '/p2')


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