def test_nbsp(self): """Test that spaces are replaced with nbsp.""" text = 'foo bar baz' expected = Markup('foo bar baz') result = nbsp(text) assert result == expected
def test_nbsp_escapes(self): """Ensure the filter escapes HTML.""" text = 'foo bar baz <script>' expected = Markup('foo bar baz <script>') result = nbsp(text) assert result == expected
def test_nbsp_with_markup(self): """When markup passed in should still return markup.""" text = Markup('foo bar baz <script>') expected = Markup('foo bar baz <script>') result = nbsp(text) assert result == expected