コード例 #1
0
 def test_repr(self):
     """
     A L{MissingRenderMethod} is represented using a custom string
     containing the element's representation and the method name.
     """
     elt = object()
     e = error.MissingRenderMethod(elt, 'renderThing')
     self.assertEqual(repr(e),
                      ("'MissingRenderMethod': "
                       "%r had no render method named 'renderThing'") % elt)
コード例 #2
0
 def test_constructor(self):
     """
     Given C{element} and C{renderName} arguments, the
     L{MissingRenderMethod} constructor assigns the values to the
     corresponding attributes.
     """
     elt = object()
     e = error.MissingRenderMethod(elt, 'renderThing')
     self.assertIs(e.element, elt)
     self.assertIs(e.renderName, 'renderThing')