Commit 2c3ec63c authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fixup! CMFCategory: keep only the first occurrence of each category while preserving order.

parent 3985f158
......@@ -86,7 +86,7 @@ to set categories</td></tr>
<tr>
<td>verifyValue</td>
<td>field_my_bar_category_title_list</td>
<td>Title 0<br />Title 1<br />Title 1</td>
<td>Title 0<br />Title 1</td>
<td></td>
</tr>
<tr>
......@@ -104,7 +104,7 @@ to set categories</td></tr>
<tr>
<td>verifyValue</td>
<td>field_my_bar_category_title_list</td>
<td>Title 0<br />Title 0<br />Title 1<br />Title 1</td>
<td>Title 0<br />Title 0<br />Title 1</td>
<td></td>
</tr>
<tr>
......@@ -122,7 +122,7 @@ to set categories</td></tr>
<tr>
<td>verifyValue</td>
<td>field_my_bar_category_title_list</td>
<td>Title 1<br />Title 0<br />Title 1</td>
<td>Title 1<br />Title 0</td>
<td></td>
</tr>
<!-- XXX don't test jump for now, because we don't have good locators anyway.
......
......@@ -638,12 +638,12 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
person.setRegionValue(alpha)
self.assertEqual(person.getRegion(), 'alpha')
person.setRegionValueList([alpha, alpha])
self.assertEqual(person.getRegionList(), ['alpha', 'alpha'])
self.assertEqual(person.getRegionList(), ['alpha'])
person.setRegionValueSet([alpha, alpha])
self.assertEqual(person.getRegionList(), ['alpha'])
self.assertEqual(person.getRegionSet(), ['alpha'])
person.setRegionValueList([alpha, beta, alpha])
self.assertEqual(person.getRegionList(), ['alpha', 'beta', 'alpha'])
self.assertEqual(person.getRegionList(), ['alpha', 'beta'])
person.setRegionValueSet([alpha, beta, alpha])
result = person.getRegionSet()
result.sort()
......@@ -676,12 +676,12 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
person.setRegion('alpha')
self.assertEqual(person.getRegion(), 'alpha')
person.setRegionList(['alpha', 'alpha'])
self.assertEqual(person.getRegionList(), ['alpha', 'alpha'])
self.assertEqual(person.getRegionList(), ['alpha'])
self.assertEqual(person.getRegionSet(), ['alpha'])
person.setRegionSet(['beta', 'alpha', 'alpha'])
self.assertEqual(person.getRegionList(), ['alpha', 'beta'])
person.setRegionList(['beta', 'alpha', 'alpha'])
self.assertEqual(person.getRegionList(), ['beta', 'alpha', 'alpha'])
self.assertEqual(person.getRegionList(), ['beta', 'alpha'])
# at this point the person have a default region set to the first item in
# the list.
self.assertEqual(person.getDefaultRegion(), 'beta')
......@@ -720,7 +720,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
person.setRegionUidSet([alpha.getUid(), alpha.getUid()])
self.assertEqual(person.getRegionList(), ['alpha'])
person.setRegionUidList([alpha.getUid(), beta.getUid(), alpha.getUid()])
self.assertEqual(person.getRegionList(), ['alpha', 'beta', 'alpha'])
self.assertEqual(person.getRegionList(), ['alpha', 'beta'])
person.setRegionUidSet([alpha.getUid(), beta.getUid(), alpha.getUid()])
self.assertEqual(sorted(person.getRegionSet()), ['alpha', 'beta'])
person.setDefaultRegionUid(beta.getUid())
......@@ -753,7 +753,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
person.setSubject('beta')
self.assertEqual(person.getSubject(), 'beta')
person.setSubjectList(['alpha', 'alpha'])
self.assertEqual(person.getSubjectList(), ['alpha', 'alpha'])
self.assertEqual(person.getSubjectList(), ['alpha'])
self.assertEqual(person.getSubjectSet(), ['alpha'])
person.setSubjectSet(['beta', 'beta'])
self.assertEqual(person.getSubjectList(), ['beta'])
......
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