summaryrefslogtreecommitdiff
path: root/ishtar_common/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r--ishtar_common/tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index ad83b4a87..349408465 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -417,6 +417,7 @@ class MergeTest(TestCase):
name='Boule', surname=' ', history_modifier=self.user,
attached_to=self.company_1)
self.person_1.person_types.add(self.person_types[0])
+
self.author_1_pk = models.Author.objects.create(
person=self.person_1, author_type=self.author_types[0]).pk
@@ -428,6 +429,9 @@ class MergeTest(TestCase):
self.person_2 = models.Person.objects.create(
name='Bill', history_modifier=self.user, surname='Peyo',
title=self.title, attached_to=self.company_2)
+ self.user.ishtaruser.person = self.person_2
+ self.user.ishtaruser.save()
+
self.person_2.person_types.add(self.person_types[1])
self.author_2_pk = models.Author.objects.create(
person=self.person_2, author_type=self.author_types[1]).pk
@@ -443,6 +447,9 @@ class MergeTest(TestCase):
self.assertEqual(self.person_1.title, self.title)
# string field with only spaces is an empty field
self.assertEqual(self.person_1.surname, 'Peyo')
+ # preserve one to one field
+ user = User.objects.get(username='username')
+ self.assertEqual(self.person_1, user.ishtaruser.person)
# preserve existing foreign key
self.assertEqual(self.person_1.attached_to, self.company_1)
# preserve existing many to many