diff --git a/docs/source/index.rst b/docs/source/index.rst index 55f5ca4a..fb29d076 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -153,8 +153,8 @@ Do a date search in a calendar: .. code-block:: python - events_fetched = my_new_calendar.date_search( - start=datetime(2021, 1, 1), end=datetime(2024, 1, 1), expand=True) + events_fetched = my_new_calendar.search( + start=datetime(2021, 1, 1), end=datetime(2024, 1, 1),event=True, expand=True) To modify an event: @@ -214,9 +214,9 @@ Date_search also works on task lists, but one has to be explicit to get the task .. code-block:: python - todos = my_new_calendar.date_search( + todos = my_new_calendar.search( start=datetime(2021, 1, 1), end=datetime(2024, 1, 1), - compfilter='VTODO', expand=True) + compfilter='VTODO',event=True, expand=True) Mark a task as completed: diff --git a/examples/basic_usage_examples.py b/examples/basic_usage_examples.py index cbeea9cf..6bdde3b0 100644 --- a/examples/basic_usage_examples.py +++ b/examples/basic_usage_examples.py @@ -72,16 +72,16 @@ ## (this may fail if the server doesn't support expand) print("Here is some icalendar data:") try: - events_fetched = my_new_calendar.date_search( - start=datetime(2021, 5, 16), end=datetime(2024, 1, 1), expand=True + events_fetched = my_new_calendar.search( + start=datetime(2021, 5, 16), end=datetime(2024, 1, 1), event=True, expand=True ) ## Note: obj.data will always return a normal string, with normal line breaks ## obj.wire_data will return a byte string with CRLN print(events_fetched[0].data) except: print("Your calendar server does apparently not support expanded search") - events_fetched = my_new_calendar.date_search( - start=datetime(2020, 5, 16), end=datetime(2024, 1, 1), expand=False + events_fetched = my_new_calendar.search( + start=datetime(2020, 5, 16), end=datetime(2024, 1, 1), event=True, expand=False ) print(events_fetched[0].data) @@ -158,10 +158,11 @@ print(todos[0].data) ## date_search also works on task lists, but one has to be explicit to get them -todos_found = my_new_tasklist.date_search( +todos_found = my_new_tasklist.search( start=datetime(2021, 1, 1), end=datetime(2024, 1, 1), - compfilter="VTODO", + todo=True, + journal=True, expand=True, ) if not todos_found: diff --git a/tests/test_caldav.py b/tests/test_caldav.py index 2a0751d4..5586ad68 100644 --- a/tests/test_caldav.py +++ b/tests/test_caldav.py @@ -4,7 +4,6 @@ Tests here communicate with third party servers and/or internal ad-hoc instances of Xandikos and Radicale, dependent on the configuration in conf_private.py. - Tests that do not require communication with a working caldav server belong in test_caldav_unit.py """ @@ -338,9 +337,7 @@ ) class TestScheduling(object): """Testing support of RFC6638. - TODO: work in progress. Stalled a bit due to lack of proper testing accounts. I haven't managed to get this test to pass at any systems yet, but I believe the problem is not on the library side. - * icloud: cannot really test much with only one test account available. I did some testing forth and back with emails sent to an account on another service through the @@ -350,14 +347,12 @@ class TestScheduling(object): the external party having accepted the calendar invite. FreeBusy doesn't work. I don't have capacity following up more right now. - * DAViCal: I have only an old version to test with at the moment, should look into that. I did manage to send and receive a calendar invite, but apparently I did not manage to accept the calendar invite. It should be looked more into. FreeBusy doesn't work in the old version, probably it works in a newer version. - * SOGo: Sending a calendar invite, but receiving nothing in the CalDAV inbox. FreeBusy works somehow, but returns pure iCalendar data and not XML, I believe that's not according to @@ -457,17 +452,13 @@ class RepeatedFunctionalTestsBaseClass(object): """This is a class with functional tests (tests that goes through basic functionality and actively communicates with third parties) that we want to repeat for all configured caldav_servers. - (what a truely ugly name for this class - any better ideas?) - NOTE: this tests relies heavily on the assumption that we can create calendars on the remote caldav server, but the RFC says ... - Support for MKCALENDAR on the server is only RECOMMENDED and not REQUIRED because some calendar stores only support one calendar per user (or principal), and those are typically pre-created for each account. - We've had some problems with iCloud and Radicale earlier. Google still does not support mkcalendar. """ @@ -790,7 +781,6 @@ def testCalendarByFullURL(self): def testObjectBySyncToken(self): """ Support for sync-collection reports, ref https://github.com/python-caldav/caldav/issues/87. - This test is using explicit calls to objects_by_sync_token """ self.skip_on_compatibility_flag("no_sync_token") @@ -919,7 +909,6 @@ def testObjectBySyncToken(self): def testSync(self): """ Support for sync-collection reports, ref https://github.com/python-caldav/caldav/issues/87. - Same test pattern as testObjectBySyncToken, but exercises the .sync() method """ self.skip_on_compatibility_flag("no_sync_token") diff --git a/tests/test_caldav_unit.py b/tests/test_caldav_unit.py index acf6de11..ffb8533d 100644 --- a/tests/test_caldav_unit.py +++ b/tests/test_caldav_unit.py @@ -5,7 +5,6 @@ communication, and there should be no dependencies on a working caldav server for the tests in this file. We use the Mock class when needed to emulate server communication. - """ import pickle from datetime import date