def test_if_image_caption_is_updated(self): body = """ "body_html" : "<p>test 33</p>\n<!-- EMBED START Image {id: \"embedded9127149191\"} -->\n <figure><img src=\"http://localhost:5000/api/upload/58ff025eb611402decdb82e1/raw?_schema=http\" alt=\"aa\" /> <figcaption>[--description--]</figcaption></figure>\n <!-- EMBED END Image {id: \"embedded9127149191\"} -->\n<p>faffaf</p> """ changed_body = """ "body_html" : "<p>test 33</p>\n<!-- EMBED START Image {id: \"embedded9127149191\"} -->\n <figure><img src=\"http://localhost:5000/api/upload/58ff025eb611402decdb82e1/raw?_schema=http\" alt=\"aa\" /> <figcaption>new caption</figcaption></figure>\n <!-- EMBED END Image {id: \"embedded9127149191\"} -->\n<p>faffaf</p> """ body = update_image_caption(body, 'embedded9127149191', 'new caption') self.assertEqual(body, changed_body)