Commit 80c30ea0 authored by Romain Courteaud's avatar Romain Courteaud

Person.getTitle uses firstname/lastname when available

parent c5923245
...@@ -89,6 +89,10 @@ class TestPerson(ERP5TypeTestCase): ...@@ -89,6 +89,10 @@ class TestPerson(ERP5TypeTestCase):
## its reference must NOT be resetted ## its reference must NOT be resetted
self.assertEqual(person_copy_obj.getReference(), person.getReference()) self.assertEqual(person_copy_obj.getReference(), person.getReference())
def test_PersonGetTitleDefined(self):
p = self._makeOne(title="title")
self.assertEqual("title", p.getTitle())
# title & first_name, last_name # title & first_name, last_name
def testEmptyTitleFallbackOnId(self): def testEmptyTitleFallbackOnId(self):
p = self._makeOne(id=self.id()) p = self._makeOne(id=self.id())
......
...@@ -175,7 +175,7 @@ class TestOOoImport(TestOOoImportMixin): ...@@ -175,7 +175,7 @@ class TestOOoImport(TestOOoImportMixin):
num = 10 num = 10
person_list = self.getPortal().person_module.objectValues() person_list = self.getPortal().person_module.objectValues()
self.assertEqual( self.assertEqual(
sorted(['John Doe %s' % (i) for i in range(num)]), ['John'] * num,
sorted([person_list[i].getTitle() for i in range(num)])) sorted([person_list[i].getTitle() for i in range(num)]))
self.assertEqual( self.assertEqual(
sorted(['John' for i in range(num)]), sorted(['John' for i in range(num)]),
...@@ -202,7 +202,7 @@ class TestOOoImport(TestOOoImportMixin): ...@@ -202,7 +202,7 @@ class TestOOoImport(TestOOoImportMixin):
num = 10 num = 10
person_list = self.getPortal().person_module.objectValues() person_list = self.getPortal().person_module.objectValues()
self.assertEqual( self.assertEqual(
sorted(['John Doe %s' % (i) for i in range(num)]), ['John'] * num,
sorted([person_list[i].getTitle() for i in range(num)])) sorted([person_list[i].getTitle() for i in range(num)]))
self.assertEqual( self.assertEqual(
sorted(['John' for i in range(num)]), sorted(['John' for i in range(num)]),
...@@ -218,7 +218,7 @@ class TestOOoImport(TestOOoImportMixin): ...@@ -218,7 +218,7 @@ class TestOOoImport(TestOOoImportMixin):
num = 10 num = 10
person_list = self.getPortal().person_module.objectValues() person_list = self.getPortal().person_module.objectValues()
self.assertEqual( self.assertEqual(
sorted(['John Doe é %s' % (i) for i in range(num)]), ['John'] * num,
sorted([person_list[i].getTitle() for i in range(num)])) sorted([person_list[i].getTitle() for i in range(num)]))
self.assertEqual( self.assertEqual(
sorted(['John' for i in range(num)]), sorted(['John' for i in range(num)]),
...@@ -239,7 +239,7 @@ class TestOOoImport(TestOOoImportMixin): ...@@ -239,7 +239,7 @@ class TestOOoImport(TestOOoImportMixin):
num = 10 num = 10
person_list = self.getPortal().person_module.objectValues() person_list = self.getPortal().person_module.objectValues()
self.assertEqual( self.assertEqual(
sorted(['John Doe %s' % (i) for i in range(num)]), ['John'] * num,
sorted([person_list[i].getTitle() for i in range(num)])) sorted([person_list[i].getTitle() for i in range(num)]))
self.assertEqual( self.assertEqual(
sorted(['John' for i in range(num)]), sorted(['John' for i in range(num)]),
......
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