Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitec87d18

Browse files
author
Derwent
committed
✅ add test for post with complex body
1 parent300f239 commitec87d18

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+
deftest_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)

[8]ページ先頭

©2009-2025 Movatter.jp