0

I use linebreaks in template. But the test can't find 'br' tag.

{{ book.short_description | linebreaks }}

This is the test

self.assertContains(response, "New<br></br>Lines")
Masked Man
  • 522
  • 1
  • 6
  • 21

1 Answers1

1

You need to set html to True in order to handle text as HTML:

self.assertContains(response, "New<br></br>Lines", html=True);

Or you can use assertHTMLEqual. I hope this will help.

Ismail RBOUH
  • 10,292
  • 2
  • 24
  • 36