snap_test_inline_bbcode.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # -*- coding: utf-8 -*-
  2. # snapshottest: v1 - https://goo.gl/zC4yUc
  3. from __future__ import unicode_literals
  4. from snapshottest import Snapshot
  5. snapshots = Snapshot()
  6. snapshots["test_bold_bbcode 1"] = "<p>Lorem <b>ipsum</b>!</p>"
  7. snapshots[
  8. "test_image_bbcode 1"
  9. ] = '<p>Lorem <img alt="placekitten.com/g/1200/500" src="https://placekitten.com/g/1200/500"/> ipsum</p>'
  10. snapshots[
  11. "test_image_bbcode_is_case_insensitive 1"
  12. ] = '<p>Lorem <img alt="placekitten.com/g/1200/500" src="https://placekitten.com/g/1200/500"/> ipsum</p>'
  13. snapshots[
  14. "test_image_bbcode_is_escaped 1"
  15. ] = "<p>Lorem <img alt='&lt;script language=\"application/javascript\"&gt;' src='http://&lt;script language=\"application/javascript\"&gt;'/> ipsum</p>"
  16. snapshots["test_inline_bbcode_can_be_mixed 1"] = "<p>Lorem <b><u>ipsum</u></b>!</p>"
  17. snapshots[
  18. "test_inline_bbcode_can_be_mixed_with_markdown 1"
  19. ] = "<p>Lorem <b><strong>ipsum</strong></b>!</p>"
  20. snapshots["test_italics_bbcode 1"] = "<p>Lorem <i>ipsum</i>!</p>"
  21. snapshots[
  22. "test_simple_inline_bbcode_is_escaped 1"
  23. ] = '<p>Lorem <b>ips &lt;script language="application/javascript"&gt; um</b>!</p>'
  24. snapshots["test_underline_bbcode 1"] = "<p>Lorem <u>ipsum</u>!</p>"
  25. snapshots[
  26. "test_url_bbcode 1"
  27. ] = '<p>Lorem <a href="https://placekitten.com/g/1200/500" rel="nofollow noopener">placekitten.com/g/1200/500</a> ipsum</p>'
  28. snapshots[
  29. "test_url_bbcode_is_escaped 1"
  30. ] = '<p>Lorem <a href=\'http://&lt;script language="application/javascript"&gt;\' rel="nofollow noopener">&lt;script language="application/javascript"&gt;</a> ipsum</p>'
  31. snapshots[
  32. "test_url_bbcode_link_text_is_escaped 1"
  33. ] = '<p>Lorem <a href=\'http://&lt;script language="application/javascript"&gt;\' rel="nofollow noopener">&lt;script language="application/javascript"&gt;</a> ipsum</p>'
  34. snapshots[
  35. "test_url_bbcode_with_link_text 1"
  36. ] = '<p>Lorem <a href="https://placekitten.com/g/1200/500" rel="nofollow noopener">dolor</a> ipsum</p>'
  37. snapshots[
  38. "test_url_bbcode_with_long_link_text 1"
  39. ] = '<p>Lorem <a href="https://placekitten.com/g/1200/500" rel="nofollow noopener">dolor met</a> ipsum</p>'
  40. snapshots[
  41. "test_url_bbcode_with_quotes_and_link_text 1"
  42. ] = '<p>Lorem <a href="https://placekitten.com/g/1200/500" rel="nofollow noopener">dolor</a> ipsum</p>'
  43. snapshots[
  44. "test_url_bbcode_with_quotes_and_long_link_text 1"
  45. ] = '<p>Lorem <a href="https://placekitten.com/g/1200/500" rel="nofollow noopener">dolor met</a> ipsum</p>'