Merge branch 'master' into optimize_storage_collection
This commit is contained in:
		| @@ -529,7 +529,8 @@ class Collection(BaseCollection): | |||||||
|             for item in items: |             for item in items: | ||||||
|                 for content in ("vevent", "vtodo", "vjournal"): |                 for content in ("vevent", "vtodo", "vjournal"): | ||||||
|                     if content in item.contents: |                     if content in item.contents: | ||||||
|                         collection.add(getattr(item, content)) |                         for item_part in getattr(item, "%s_list" % content): | ||||||
|  |                             collection.add(item_part) | ||||||
|                         break |                         break | ||||||
|             return collection.serialize() |             return collection.serialize() | ||||||
|         elif self.get_meta("tag") == "VADDRESSBOOK": |         elif self.get_meta("tag") == "VADDRESSBOOK": | ||||||
|   | |||||||
| @@ -28,5 +28,15 @@ SUMMARY:Event2 | |||||||
| DTSTART;TZID=Europe/Paris:20130902T180000 | DTSTART;TZID=Europe/Paris:20130902T180000 | ||||||
| DTEND;TZID=Europe/Paris:20130902T190000 | DTEND;TZID=Europe/Paris:20130902T190000 | ||||||
| RRULE:FREQ=WEEKLY | RRULE:FREQ=WEEKLY | ||||||
|  | SEQUENCE:1 | ||||||
|  | END:VEVENT | ||||||
|  | BEGIN:VEVENT | ||||||
|  | DTSTART;TZID=Europe/Paris:20130910T170000 | ||||||
|  | DTEND;TZID=Europe/Paris:20130910T180000 | ||||||
|  | DTSTAMP:20140902T150158Z | ||||||
|  | SUMMARY:Event2 | ||||||
|  | UID:event2 | ||||||
|  | RECURRENCE-ID;TZID=Europe/Paris:20130909T180000 | ||||||
|  | SEQUENCE:2 | ||||||
| END:VEVENT | END:VEVENT | ||||||
| END:VCALENDAR | END:VCALENDAR | ||||||
|   | |||||||
| @@ -97,6 +97,20 @@ class BaseRequests: | |||||||
|         status, headers, answer = self.request("GET", "/calendar.ics/") |         status, headers, answer = self.request("GET", "/calendar.ics/") | ||||||
|         assert "VEVENT" not in answer |         assert "VEVENT" not in answer | ||||||
|  |  | ||||||
|  |     def test_multiple_events_with_same_uid(self): | ||||||
|  |         """Add two events with the same UID.""" | ||||||
|  |         self.request("MKCOL", "/calendar.ics/") | ||||||
|  |         self.request("PUT", "/calendar.ics/", get_file_content("event2.ics")) | ||||||
|  |         status, headers, answer = self.request( | ||||||
|  |             "REPORT", "/calendar.ics/", | ||||||
|  |             """<?xml version="1.0" encoding="utf-8" ?> | ||||||
|  |                <C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav"> | ||||||
|  |                  <D:prop xmlns:D="DAV:"><D:getetag/></D:prop> | ||||||
|  |                </C:calendar-query>""") | ||||||
|  |         assert answer.count("<getetag>") == 1 | ||||||
|  |         status, headers, answer = self.request("GET", "/calendar.ics/") | ||||||
|  |         assert answer.count("BEGIN:VEVENT") == 2 | ||||||
|  |  | ||||||
|     def _test_filter(self, filters, kind="event", items=1): |     def _test_filter(self, filters, kind="event", items=1): | ||||||
|         filters_text = "".join( |         filters_text = "".join( | ||||||
|             "<C:filter>%s</C:filter>" % filter_ for filter_ in filters) |             "<C:filter>%s</C:filter>" % filter_ for filter_ in filters) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Florian Mounier
					Florian Mounier