title: Unit testing text to html throwing assertion error because of extra characters
body: <p>I have this function:</p>
  <pre><code>def text_to_html(text):
      &quot;&quot;&quot;
      Convert text into HTML
      Args:
          text (): text to convert
  
      Returns:
          HTML string
      &quot;&quot;&quot;
      html = &quot;&lt;p&gt;&quot; + text.replace(&quot;\n&quot;, &quot;&lt;br&gt;&quot;) + &quot;&lt;/p&gt;&quot;
      return html
  </code></pre>
  <p>I'm trying to create a unit test for this function like this.</p>
  <pre><code>class TestDebtModules(unittest.TestCase):
      def test_html(self):
          string = &quot;&quot;&quot;
          THIS
          IS A TEST
          STRING
          &quot;&quot;&quot;
          string_input = text_to_html(string)
          string_output = r'&lt;p&gt;&lt;br&gt;THIS &lt;br&gt;IS A TEST &lt;br&gt;STRING&lt;br&gt;&lt;/p&gt;'
          self.assertEqual(string_input, string_output)
  </code></pre>
  <p>However. it's throwing an assertion error because it's adding extra characters in my string. Is this a known bug or is it me doing something wrong? (Hopefully the latter). If it happens to be the former, is there any workaround for this?</p>
  <pre><code>Expected :&lt;p&gt;&lt;br&gt;        THIS&lt;br&gt;        IS A TEST&lt;br&gt;        STRING&lt;br&gt;        &lt;/p&gt;
  Actual   :&lt;p&gt;&lt;br&gt;THIS &lt;br&gt;IS A TEST &lt;br&gt;STRING&lt;br&gt;&lt;/p&gt;
  </code></pre>