Skip to content

Commit 50669dc

Browse files
author
derwentx
committed
Split tests into multiple files
additional tests for images
1 parent 51fcb5f commit 50669dc

File tree

9 files changed

+1258
-1175
lines changed

9 files changed

+1258
-1175
lines changed

README.rst

+9-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ Upload an image
263263
endpoint = "/media"
264264
return wpapi.post(endpoint, data, headers=headers)
265265
266-
267266
Response
268267
--------
269268

@@ -298,6 +297,15 @@ According the the [documentation](https://developer.wordpress.org/rest-api/refer
298297
>>> response.json()
299298
{“deleted”:true, ... }
300299
300+
A Note on Encoding
301+
====
302+
303+
In Python2, make sure to only `POST` unicode string objects or strings that
304+
have been correctly encoded as utf-8. Serializing objects containing non-utf8
305+
byte strings in Python2 is broken by importing `unicode_literals` from
306+
`__future__` because of a bug in `json.dumps`. You may be able to get around
307+
this problem by serializing the data yourself.
308+
301309
302310
Changelog
303311
---------

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
test=pytest
33
[tool:pytest]
44
addopts = --verbose
5-
python_files = tests.py
5+
python_files = tests/test_*.py
66
[pylama]
77
skip=\.*,build/*,dist/*,*.egg-info
88
[pylama:tests.py]

0 commit comments

Comments
 (0)