test: add cases for user/path value check
This commit is contained in:
@@ -623,6 +623,44 @@ permissions: RrWw""")
|
||||
self.get(path1, check=404)
|
||||
self.get(path2)
|
||||
|
||||
def test_move_unicode(self) -> None:
|
||||
"""Move a item."""
|
||||
self.mkcalendar("/calendar.ics/")
|
||||
event = get_file_content("event1.ics")
|
||||
path1 = "/calendar.ics/event😀1.ics"
|
||||
path2 = "/calendar.ics/event😁2.ics"
|
||||
self.put(path1, event)
|
||||
self.request("MOVE", path1, check=201,
|
||||
HTTP_DESTINATION="http://127.0.0.1/"+path2)
|
||||
self.get(path1, check=404)
|
||||
self.get(path2)
|
||||
|
||||
def test_move_strict_unicode_dst(self) -> None:
|
||||
"""Move a item."""
|
||||
self.configure({"server": {"validate_path_value": "strict"}})
|
||||
self.mkcalendar("/calendar.ics/")
|
||||
event = get_file_content("event1.ics")
|
||||
path1 = "/calendar.ics/event1.ics"
|
||||
path2 = "/calendar.ics/event😁2.ics"
|
||||
self.put(path1, event)
|
||||
self.request("MOVE", path1, check=400,
|
||||
HTTP_DESTINATION="http://127.0.0.1/"+path2)
|
||||
self.get(path1, check=200)
|
||||
self.get(path2, check=400)
|
||||
|
||||
def test_move_strict_unicode_src(self) -> None:
|
||||
"""Move a item."""
|
||||
self.configure({"server": {"validate_path_value": "strict"}})
|
||||
self.mkcalendar("/calendar.ics/")
|
||||
event = get_file_content("event1.ics")
|
||||
path1 = "/calendar.ics/event😀1.ics"
|
||||
path2 = "/calendar.ics/event2.ics"
|
||||
self.put(path1, event, check=400)
|
||||
self.request("MOVE", path1, check=400,
|
||||
HTTP_DESTINATION="http://127.0.0.1/"+path2)
|
||||
self.get(path1, check=400)
|
||||
self.get(path2, check=404)
|
||||
|
||||
def test_move_between_collections(self) -> None:
|
||||
"""Move a item."""
|
||||
self.mkcalendar("/calendar1.ics/")
|
||||
|
||||
Reference in New Issue
Block a user