<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>a666666</author_name>
  <author_url>https://blog.hatena.ne.jp/a666666/</author_url>
  <blog_title>@kyanny's blog</blog_title>
  <blog_url>https://blog.kyanny.me/</blog_url>
  <categories>
  </categories>
  <description>needle （検索したいもの）が HTML タグを含まない文字列の場合、 assertContains の感覚で「needle と一致する文字列が haystack の中にあれば OK」という使い方をしてしまいがちだが、 assertInHTML は HTML の木構造を意識するので「あるはずの文字列が見つからない！」というエラーで頭を抱えることになる。 以下の例のように、 haystack の HTML 構造内で任意の子要素と完全一致するような needle を与えれば OK。 gist.github.com ❯ python t.py -v test_not_ok (__main__.I…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.kyanny.me%2Fentry%2F2020%2F12%2F29%2F120322&quot; title=&quot;Django: assertInHTML は needle が haystack の任意の子要素と完全一致しないと Fail する - @kyanny&amp;#39;s blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-12-29 12:03:22</published>
  <title>Django: assertInHTML は needle が haystack の任意の子要素と完全一致しないと Fail する</title>
  <type>rich</type>
  <url>https://blog.kyanny.me/entry/2020/12/29/120322</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
