Test REPORT on item

Test for 90e4655a44ef801211da18ebb5bf57d75b7cd498
This commit is contained in:
Unrud 2016-09-01 06:17:18 +02:00
parent 9d2743d797
commit 3df367aad2

View File

@ -734,6 +734,24 @@ class BaseRequestsMixIn:
assert "href>/calendar.ics/journal1.ics</" not in answer
assert "href>/calendar.ics/journal2.ics</" not in answer
def test_report_item(self):
"""Test report request on an item"""
calendar_path = "/calendar.ics/"
self.request("MKCALENDAR", calendar_path)
event = get_file_content("event1.ics")
event_path = posixpath.join(calendar_path, "event.ics")
self.request("PUT", event_path, event)
status, headers, answer = self.request(
"REPORT", event_path,
"""<?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 status == 207
assert "href>%s<" % event_path in answer
def test_authorization(self):
authorization = "Basic " + base64.b64encode(b"user:").decode()
status, headers, answer = self.request(