Test PROPPATCH
This commit is contained in:
parent
51bf95f00d
commit
62892e3423
6
radicale/tests/static/propfind1.xml
Normal file
6
radicale/tests/static/propfind1.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<D:propfind xmlns:D="DAV:">
|
||||||
|
<D:prop>
|
||||||
|
<I:calendar-color xmlns:I="http://apple.com/ns/ical/" />
|
||||||
|
</D:prop>
|
||||||
|
</D:propfind>
|
8
radicale/tests/static/proppatch1.xml
Normal file
8
radicale/tests/static/proppatch1.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<D:propertyupdate xmlns:D="DAV:">
|
||||||
|
<D:set>
|
||||||
|
<D:prop>
|
||||||
|
<I:calendar-color xmlns:I="http://apple.com/ns/ical/">#BADA55</I:calendar-color>
|
||||||
|
</D:prop>
|
||||||
|
</D:set>
|
||||||
|
</D:propertyupdate>
|
@ -213,6 +213,23 @@ class BaseRequestsMixIn:
|
|||||||
assert "href>%s</" % calendar_path in answer
|
assert "href>%s</" % calendar_path in answer
|
||||||
assert "href>%s</" % event_path in answer
|
assert "href>%s</" % event_path in answer
|
||||||
|
|
||||||
|
def test_proppatch(self):
|
||||||
|
"""Write a property and read it back."""
|
||||||
|
self.request("MKCALENDAR", "/calendar.ics/")
|
||||||
|
proppatch = get_file_content("proppatch1.xml")
|
||||||
|
status, headers, answer = self.request(
|
||||||
|
"PROPPATCH", "/calendar.ics/", proppatch)
|
||||||
|
assert status == 207
|
||||||
|
assert "calendar-color" in answer
|
||||||
|
assert "200 OK</status" in answer
|
||||||
|
# Read property back
|
||||||
|
propfind = get_file_content("propfind1.xml")
|
||||||
|
status, headers, answer = self.request(
|
||||||
|
"PROPFIND", "/calendar.ics/", propfind)
|
||||||
|
assert status == 207
|
||||||
|
assert ":calendar-color>#BADA55</" in answer
|
||||||
|
assert "200 OK</status" in answer
|
||||||
|
|
||||||
def test_multiple_events_with_same_uid(self):
|
def test_multiple_events_with_same_uid(self):
|
||||||
"""Add two events with the same UID."""
|
"""Add two events with the same UID."""
|
||||||
self.request("MKCOL", "/calendar.ics/")
|
self.request("MKCOL", "/calendar.ics/")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user