8000 ✅ add test for post with complex body · shopro/wp-api-python@ec87d18 · GitHub
[go: up one dir, main page]

Skip to content

Commit ec87d18

Browse files
author
Derwent
committed
✅ add test for post with complex body
1 parent 300f239 commit ec87d18

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_api.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,20 @@ def test_APIPostMedia(self):
482482

483483
self.wpapi.delete('media/%s?force=True' % created_id)
484484

485+
def test_APIPostComplexContent(self):
486+
data = {
487+
'content': "this content has <a href='#'>links</a>"
488+
}
489+
res = self.wpapi.post('posts', data)
490+
491+
self.assertEqual(res.status_code, 201)
492+
res_obj = res.json()
493+
res_id= res_obj.get('id')
494+
self.assertTrue(res_id)
495+
print(res_obj)
496+
res_content = res_obj.get('content').get('raw')
497+
self.assertEqual(data.get('content'), res_content)
498+
485499
# def test_APIPostMediaBadCreds(self):
486500
# """
487501
# TODO: make sure the warning is "ensure login and basic auth is installed"

0 commit comments

Comments
 (0)
0