예제 #1
0
 def test_make_multipart_empty_filename(self):
     field = RequestField("somename", "data", "")
     field.make_multipart(content_type="application/octet-stream")
     assert (
         field.render_headers()
         == 'Content-Disposition: form-data; name="somename"; filename=""\r\n'
         "Content-Type: application/octet-stream\r\n"
         "\r\n"
     )
예제 #2
0
 def test_make_multipart(self):
     field = RequestField("somename", "data")
     field.make_multipart(content_type="image/jpg", content_location="/test")
     assert (
         field.render_headers()
         == 'Content-Disposition: form-data; name="somename"\r\n'
         "Content-Type: image/jpg\r\n"
         "Content-Location: /test\r\n"
         "\r\n"
     )