diff --git a/modoboa/calendars/mocks.py b/modoboa/calendars/mocks.py index a06d524b5..702c9ce83 100644 --- a/modoboa/calendars/mocks.py +++ b/modoboa/calendars/mocks.py @@ -49,6 +49,9 @@ class Calendar: def add_event(self, data): return True + def save_event(self, *args, **kwargs): + return True + def event_by_url(self, url): res = objects.Event(url=url, data=EV1, parent=self) return res diff --git a/modoboa/calendars/tests.py b/modoboa/calendars/tests.py index 503c9e8e6..5ef224309 100644 --- a/modoboa/calendars/tests.py +++ b/modoboa/calendars/tests.py @@ -428,8 +428,8 @@ class EventViewSetTestCase(TestDataMixin, ModoAPITestCase): url = f"/api/v2/user-calendars/{self.calendar.pk}/events/" data = { "title": "Test event", - "start": "2018-03-27T00:00:00Z", - "end": "2018-03-28T00:00:00Z", + "start_date": "2018-03-27", + "end_date": "2018-03-28", "allDay": True, "color": "#ffdddd", "description": "Description", @@ -483,8 +483,8 @@ class EventViewSetTestCase(TestDataMixin, ModoAPITestCase): url = f"/api/v2/user-calendars/{self.calendar.pk}/events/1234/" data = { - "start": "2018-03-27T00:00:00Z", - "end": "2018-03-28T00:00:00Z", + "start_date": "2018-03-27", + "end_date": "2018-03-28", "allDay": True, } response = self.client.patch(url, data=data, format="json") @@ -496,8 +496,8 @@ class EventViewSetTestCase(TestDataMixin, ModoAPITestCase): self.client.post(reverse("core:login"), data) data = { "title": "Test event", - "start": "2018-03-27T00:00:00Z", - "end": "2018-03-28T00:00:00Z", + "start_date": "2018-03-27", + "end_date": "2018-03-28", "allDay": True, "color": "#ffdddd", "description": "Description",