-
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into test_restructure_test_encoding_create_from…
…_ical
- Loading branch information
Showing
6 changed files
with
88 additions
and
87 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/icalendar/tests/calendars/created_calendar_with_unicode_fields.ics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
PRODID:-//Plönë.org//NONSGML plone.app.event//EN | ||
X-WR-CALDESC:test non ascii: äöü ÄÖÜ € | ||
X-WR-CALNAME:äöü ÄÖÜ € | ||
X-WR-RELCALID:12345 | ||
BEGIN:VEVENT | ||
SUMMARY:Non-ASCII Test: ÄÖÜ äöü € | ||
DTSTART;VALUE=DATE-TIME:20101010T100000Z | ||
DTEND;VALUE=DATE-TIME:20101010T120000Z | ||
UID:123456 | ||
CREATED;VALUE=DATE-TIME:20101010T000000Z | ||
DESCRIPTION:icalendar should be able to de/serialize non-ascii. | ||
LOCATION:Tribstrül | ||
END:VEVENT | ||
BEGIN:VEVENT | ||
SUMMARY:åäö | ||
DTSTART;VALUE=DATE-TIME:20101010T000000Z | ||
END:VEVENT | ||
BEGIN:VEVENT | ||
DESCRIPTION:äöüßÄÖÜ | ||
END:VEVENT | ||
END:VCALENDAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
BEGIN:VEVENT | ||
ATTACH;ENCODING=BASE64;FMTTYPE=text/plain;VALUE=BINARY:dGV4dA== | ||
END:VEVENT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
'''tests ensuring that *the* way of doing things works''' | ||
|
||
import datetime | ||
|
||
from icalendar import Calendar, Event | ||
|
||
import pytest | ||
|
||
def test_creating_calendar_with_unicode_fields(calendars, utc): | ||
''' create a calendar with events that contain unicode characters in their fields ''' | ||
cal = Calendar() | ||
cal.add('PRODID', '-//Plönë.org//NONSGML plone.app.event//EN') | ||
cal.add('VERSION', '2.0') | ||
cal.add('X-WR-CALNAME', 'äöü ÄÖÜ €') | ||
cal.add('X-WR-CALDESC', 'test non ascii: äöü ÄÖÜ €') | ||
cal.add('X-WR-RELCALID', '12345') | ||
|
||
event = Event() | ||
event.add('DTSTART', datetime.datetime(2010, 10, 10, 10, 0, 0, tzinfo=utc)) | ||
event.add('DTEND', datetime.datetime(2010, 10, 10, 12, 0, 0, tzinfo=utc)) | ||
event.add('CREATED', datetime.datetime(2010, 10, 10, 0, 0, 0, tzinfo=utc)) | ||
event.add('UID', '123456') | ||
event.add('SUMMARY', 'Non-ASCII Test: ÄÖÜ äöü €') | ||
event.add('DESCRIPTION', 'icalendar should be able to de/serialize non-ascii.') | ||
event.add('LOCATION', 'Tribstrül') | ||
cal.add_component(event) | ||
|
||
# test_create_event_simple | ||
event1 = Event() | ||
event1.add('DTSTART', datetime.datetime(2010, 10, 10, 0, 0, 0, tzinfo=utc)) | ||
event1.add('SUMMARY', 'åäö') | ||
cal.add_component(event1) | ||
|
||
# test_unicode_parameter_name | ||
# test for issue #80 https://github.com/collective/icalendar/issues/80 | ||
event2 = Event() | ||
event2.add('DESCRIPTION', 'äöüßÄÖÜ') | ||
cal.add_component(event2) | ||
|
||
assert cal.to_ical() == calendars.created_calendar_with_unicode_fields.raw_ics | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters