Commit 1e368c04 authored by Jérome Perrin's avatar Jérome Perrin

use more realistic genders


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34746 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1f22662d
...@@ -375,12 +375,15 @@ class TestListField(ERP5TypeTestCase): ...@@ -375,12 +375,15 @@ class TestListField(ERP5TypeTestCase):
"""Create some categories into gender """Create some categories into gender
""" """
category_tool = self.portal.portal_categories category_tool = self.portal.portal_categories
category_dict = {'a':1, 'b':2, 'd':3, 'c':4, 'e':None, 'g':None, 'f':None}
if len(category_tool.gender.contentValues()) == 0 : if len(category_tool.gender.contentValues()) == 0 :
for category_id, int_index in category_dict.items():
category_tool.gender.newContent(portal_type='Category', category_tool.gender.newContent(portal_type='Category',
id=category_id, id='male',
int_index=int_index) title='Male',
int_index=1)
category_tool.gender.newContent(portal_type='Category',
id='female',
title='Female',
int_index=2)
def test_render_odt(self): def test_render_odt(self):
items = [('My first Line', '1'), ('My Second Line', '2')] items = [('My first Line', '1'), ('My Second Line', '2')]
...@@ -417,17 +420,15 @@ class TestListField(ERP5TypeTestCase): ...@@ -417,17 +420,15 @@ class TestListField(ERP5TypeTestCase):
category_item_list = field.get_value('items') category_item_list = field.get_value('items')
self.assertEquals(category_item_list, self.assertEquals(category_item_list,
[['', ''], ['e', 'e'], ['f', 'f'], ['g', 'g'], ['a', 'a'], ['b', 'b'], [['', ''], ['Male', 'male'], ['Female', 'female']])
['d', 'd'], ['c', 'c']])
# try on a person to select on gender and check if the result is the same # try on a person to select on gender and check if the result is the same
person_module = self.portal.getDefaultModule('Person') person_module = self.portal.getDefaultModule('Person')
person = person_module.newContent(portal_type='Person') person = person_module.newContent(portal_type='Person')
person.setGender('b') person.setGender('female')
self.assertEquals(person.getGender(), 'b') self.assertEquals(person.getGender(), 'female')
self.assertEquals(person.Person_view.my_gender.get_value('items'), self.assertEquals(person.Person_view.my_gender.get_value('items'),
[['', ''], ['e', 'e'], ['f', 'f'], ['g', 'g'], ['a', 'a'], ['b', 'b'], [['', ''], ['Male', 'male'], ['Female', 'female']])
['d', 'd'], ['c', 'c']])
class TestMultiListField(ERP5TypeTestCase): class TestMultiListField(ERP5TypeTestCase):
......
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