Commit dae7ddba authored by Jérome Perrin's avatar Jérome Perrin

testCMFCategory: test/document a bit more cases of update of related categories

Add a few assertions and comment to make it clearer what is the expected
behavior on related documents and on the category itself when categories
are renamed or moved.
parent 3087327a
......@@ -482,8 +482,12 @@ class TestCMFCategory(ERP5TypeTestCase):
self.assertEqual(west,
self.portal.portal_categories.resolveCategory('region/europe/ouest'))
# documents using this category are updated
self.assertEqual(p1.getRegion(), 'europe/ouest/france')
self.assertTrue(p1 in west.getRegionRelatedValueList())
# category itself is also updated
self.assertEqual(['region/europe/ouest'], west.getCategoryList())
self.assertEqual(['region/europe/ouest/france'], west.france.getCategoryList())
def test_13b_RenameCategoryUsingCutAndPaste(self):
france = self.portal.portal_categories.resolveCategory(
......@@ -502,8 +506,11 @@ class TestCMFCategory(ERP5TypeTestCase):
self.assertEqual(west,
self.portal.portal_categories.resolveCategory('region/west'))
# documents using this category are updated
self.assertEqual(p1.getRegion(), 'west/france')
self.assertTrue(p1 in west.getRegionRelatedValueList())
# category itself is also updated ( but we need to get it in its new acquisition context )
self.assertEqual(['region/west'], self.portal.portal_categories.region.west.getCategoryList())
def test_13c_RenameCategoryUsingCutAndPasteButNotCopy(self):
france = self.portal.portal_categories.resolveCategory(
......@@ -523,11 +530,10 @@ class TestCMFCategory(ERP5TypeTestCase):
self.assertEqual(west,
self.portal.portal_categories.resolveCategory('region/europe/west'))
self.assertEqual(p1.getRegion(), 'europe/west/france')
# we are not member of the copy
# documents using the category are not member of the copy
self.assertTrue('west/france' not in p1.getRegionList())
self.assertTrue(p1 in west.getRegionRelatedValueList())
def test_14_MultiplePortalTypes(self):
""" Checks that categories support different value per portal_type,
like a colored graph on portal_type"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment