summaryrefslogtreecommitdiff
path: root/debian/patches/vcard-Fix-ORG-fields-with-multiple-components.patch
blob: befb779c3ce27e74179be23db9d34b45064d2b38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From: Markus Unterwaditzer <markus@unterwaditzer.net>
Date: Wed, 13 Apr 2016 22:43:39 +0200
Subject: vcard: Fix ORG fields with multiple components

---
 test_files/simple_3_0_test.ics | 2 +-
 tests.py                       | 7 ++++++-
 vobject/vcard.py               | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/test_files/simple_3_0_test.ics b/test_files/simple_3_0_test.ics
index d5e4642..1faf80d 100644
--- a/test_files/simple_3_0_test.ics
+++ b/test_files/simple_3_0_test.ics
@@ -9,5 +9,5 @@ TEL;type=CELL:+01-(0)5-555.55.55
 ACCOUNT;type=HOME:010-1234567-05
 ADR;type=HOME:;;Haight Street 512\;\nEscape\, Test;Novosibirsk;;80214;Gnuland
 TEL;type=HOME:+01-(0)2-876.54.32
-ORG:University of Novosibirsk, Department of Octopus Parthenogenesis
+ORG:University of Novosibirsk;Department of Octopus Parthenogenesis
 END:VCARD
diff --git a/tests.py b/tests.py
index 2073930..6b0fad9 100644
--- a/tests.py
+++ b/tests.py
@@ -516,9 +516,14 @@ class TestVcards(unittest.TestCase):
         #)
         self.assertEqual(
             card.org.value,
-            "University of Novosibirsk, Department of Octopus Parthenogenesis"
+            ["University of Novosibirsk", "Department of Octopus Parthenogenesis"]
         )
 
+        for _ in range(3):
+            new_card = base.readOne(card.serialize())
+            self.assertEqual(new_card.org.value, card.org.value)
+            card = new_card
+
 
 class TestIcalendar(unittest.TestCase):
     """
diff --git a/vobject/vcard.py b/vobject/vcard.py
index dd60b73..0aec844 100644
--- a/vobject/vcard.py
+++ b/vobject/vcard.py
@@ -338,6 +338,7 @@ class OrgBehavior(VCardBehavior):
         if obj.isNative:
             return obj
         obj.isNative = True
+        obj.value = splitFields(obj.value)
         return obj
 
     @staticmethod