summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-02-16 23:29:38 +0100
committerThomas Bruederli <bruederli@kolabsys.com>2015-02-16 23:29:38 +0100
commitf69ed719f3c38190f63618191a8d2f4b61522393 (patch)
treebb0ecdfc343a8df68d9b537db3a21661d0c2200d
parentbe1851eab49b61e958840fb254f8460fd331efaa (diff)
downloadpykolab-f69ed719f3c38190f63618191a8d2f4b61522393.tar.gz
Fix property_to_string() utiliy function and its tests
-rw-r--r--pykolab/xml/utils.py2
-rw-r--r--tests/unit/test-003-event.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/pykolab/xml/utils.py b/pykolab/xml/utils.py
index a3ecbcf..9ff29b6 100644
--- a/pykolab/xml/utils.py
+++ b/pykolab/xml/utils.py
@@ -183,7 +183,7 @@ def property_to_string(propname, value):
elif propname == 'rrule':
from . import recurrence_rule
- rrule = recurrence_rule.frequency_label(value['frequency']) % (value['interval'])
+ rrule = recurrence_rule.frequency_label(value['freq']) % (value['interval'])
if value.has_key('count') and value['count'] > 0:
rrule += " " + _("for %d times") % (value['count'])
elif value.has_key('until') and (isinstance(value['until'], datetime.datetime) or isinstance(value['until'], datetime.date)):
diff --git a/tests/unit/test-003-event.py b/tests/unit/test-003-event.py
index 10e6abd..02520e7 100644
--- a/tests/unit/test-003-event.py
+++ b/tests/unit/test-003-event.py
@@ -806,10 +806,10 @@ END:VEVENT
def test_026_property_to_string(self):
data = event_from_string(xml_event).to_dict()
self.assertEqual(property_to_string('sequence', data['sequence']), "1")
- self.assertEqual(property_to_string('start', data['start']), "2014-08-13 10:00 (GMT)")
+ self.assertEqual(property_to_string('start', data['start']), "2014-08-13 10:00 (BST)")
self.assertEqual(property_to_string('organizer', data['organizer']), "Doe, John")
self.assertEqual(property_to_string('attendee', data['attendee'][0]), "jane@example.org, Accepted")
- self.assertEqual(property_to_string('rrule', data['rrule']), "Every 1 day(s) until 2014-07-25")
+ self.assertEqual(property_to_string('rrule', data['rrule']), "Every 1 day(s) until 2015-07-25")
self.assertEqual(property_to_string('exdate', data['exdate'][0]), "2014-07-19")
self.assertEqual(property_to_string('alarm', data['alarm'][0]), "Display message 2 hour(s) before")
self.assertEqual(property_to_string('attach', data['attach'][0]), "noname.1395223627.5555")