summaryrefslogtreecommitdiff
path: root/debian/patches/vcard-Fix-ORG-fields-with-multiple-components.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/vcard-Fix-ORG-fields-with-multiple-components.patch')
-rw-r--r--debian/patches/vcard-Fix-ORG-fields-with-multiple-components.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/debian/patches/vcard-Fix-ORG-fields-with-multiple-components.patch b/debian/patches/vcard-Fix-ORG-fields-with-multiple-components.patch
new file mode 100644
index 0000000..befb779
--- /dev/null
+++ b/debian/patches/vcard-Fix-ORG-fields-with-multiple-components.patch
@@ -0,0 +1,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