Out of curiosity, why endswith here and not `eq_(output, 'foo&lt;span&gt;bar&lt;/span&gt;')`? Is there more stuff at the beginning of the string?