diff --git a/src/icalendar/tests/events/issue_355_url_escaping_2.ics b/src/icalendar/tests/events/issue_355_url_escaping_2.ics new file mode 100644 index 00000000..53b8ad3c --- /dev/null +++ b/src/icalendar/tests/events/issue_355_url_escaping_2.ics @@ -0,0 +1,8 @@ +BEGIN:VEVENT +DTSTAMP:20220822T164528Z +UID:1661186704812-62650@ical.marudot.com +DTSTART;TZID=Europe/Berlin:20220822T120000 +DTEND;TZID=Europe/Berlin:20220822T120000 +SUMMARY:test +DESCRIPTION:https://www.facebook.com/events/756119502186737/?acontext=%7B%22source%22%3A5%2C%22action_history%22%3A[%7B%22surface%22%3A%22page%22%2C%22mechanism%22%3A%22main_list%22%2C%22extra_data%22%3A%22%5C%22[]%5C%22%22%7D]%2C%22has_source%22%3Atrue%7D +END:VEVENT \ No newline at end of file diff --git a/src/icalendar/tests/test_issue_355_url_escaping.py b/src/icalendar/tests/test_issue_355_url_escaping.py index 42734ad9..c4fc61b6 100644 --- a/src/icalendar/tests/test_issue_355_url_escaping.py +++ b/src/icalendar/tests/test_issue_355_url_escaping.py @@ -9,3 +9,11 @@ def test_facebook_link_is_correctly_parsed(events): see https://github.com/collective/icalendar/pull/356#issuecomment-1222626128 """ events.issue_355_url_escaping["DESCRIPTION"] == "https://www.facebook.com/events/756119502186737/?acontext=%7B%22source%22%3A5%2C%22action_history%22%3A[%7B%22surface%22%3A%22page%22%2C%22mechanism%22%3A%22main_list%22%2C%22extra_data%22%3A%22%5C%22[]%5C%22%22%7D]%2C%22has_source%22%3Atrue%7D" + +def test_other_facebook_link_is_correctly_parsed(events): + """The facebook link must not be damaged. + + see https://github.com/collective/icalendar/pull/356#issuecomment-1265872696 + """ + expected_result = 'https://www.facebook.com/events/756119502186737/?acontext=%7B%22source%22%3A5%2C%22action_history%22%3A[%7B%22surface%22%3A%22page%22%2C%22mechanism%22%3A%22main_list%22%2C%22extra_data%22%3A%22%5C%22[]%5C%22%22%7D]%2C%22has_source%22%3Atrue%7D' + events.issue_355_url_escaping_2["DESCRIPTION"] == expected_result