def test_exceptionviews__ValidationErrorView__3(self): """It quotes HTML characters correctly.""" err = ValidationError(u"The <error> & me.") view = ValidationErrorView(err, None) self.assertEqual( view.snippet(), '<span class="error">The <error> & me.</span>')
def test_exceptionviews__ValidationErrorView__4(self): """It converts the exception argument of an ConversionError as well.""" err = ConversionError(ValidationError("not valid")) view = ValidationErrorView(err, None) self.assertEqual( view.snippet(), '<span class="error">not valid</span>')
def test_exceptionviews__ValidationErrorView__2(self): """It converts also unicode an html snippet.""" err = ValidationError(u"Fälscher!") view = ValidationErrorView(err, None) self.assertEqual( view.snippet(), u'<span class="error">Fälscher!</span>')
def test_exceptionviews__ValidationErrorView__1(self): """It converts an invariant error to an html snippet.""" err = ValidationError("Bad error! Bad!") view = ValidationErrorView(err, None) self.assertEqual( view.snippet(), '<span class="error">Bad error! Bad!</span>')