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