-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #916 from rolepoint/master
Add optional flag for quoting fields
- Loading branch information
Showing
3 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,6 +155,20 @@ def test_invalid_formdata_content_transfer_encoding(): | |
# ------------- access logger ------------------------- | ||
|
||
|
||
def test_formdata_field_name_is_quoted(): | ||
form = helpers.FormData() | ||
form.add_field("emails[]", "[email protected]", content_type="multipart/form-data") | ||
res = b"".join(form("ascii")) | ||
assert b'name="emails%5B%5D"' in res | ||
|
||
|
||
def test_formdata_field_name_is_not_quoted(): | ||
form = helpers.FormData(quote_fields=False) | ||
form.add_field("emails[]", "[email protected]", content_type="multipart/form-data") | ||
res = b"".join(form("ascii")) | ||
assert b'name="emails[]"' in res | ||
|
||
|
||
def test_access_logger_format(): | ||
log_format = '%T {%{SPAM}e} "%{ETag}o" %X {X} %%P %{FOO_TEST}e %{FOO1}e' | ||
mock_logger = mock.Mock() | ||
|