Test MOVE between collections

This commit is contained in:
Unrud 2018-11-03 21:02:28 +00:00
parent 818c9e273e
commit e5c4373606

View File

@ -303,6 +303,25 @@ class BaseRequestsMixIn:
status, _, _ = self.request("GET", path2) status, _, _ = self.request("GET", path2)
assert status == 200 assert status == 200
def test_move_between_colections(self):
"""Move a item."""
status, _, _ = self.request("MKCALENDAR", "/calendar1.ics/")
assert status == 201
status, _, _ = self.request("MKCALENDAR", "/calendar2.ics/")
assert status == 201
event = get_file_content("event1.ics")
path1 = "/calendar1.ics/event1.ics"
path2 = "/calendar2.ics/event2.ics"
status, _, _ = self.request("PUT", path1, event)
assert status == 201
status, _, _ = self.request(
"MOVE", path1, HTTP_DESTINATION=path2, HTTP_HOST="")
assert status == 201
status, _, _ = self.request("GET", path1)
assert status == 404
status, _, _ = self.request("GET", path2)
assert status == 200
def test_head(self): def test_head(self):
status, _, _ = self.request("HEAD", "/") status, _, _ = self.request("HEAD", "/")
assert status == 302 assert status == 302