def test_validate(self): widget = Widget(required=True, name='first_name') widget.validate() self.assertEqual(widget.value, u'') self.assertTrue(widget.error)
def test_render(self): widget = Widget(name='first_name') self.assertEqual(widget.render(), '<input type="hidden" name="first_name" />') self.assertEqual(unicode(widget), '<input type="hidden" name="first_name" />')
def test_ingest_POST(self): widget = Widget(name='first_name') widget.ingest_POST(self.POST) self.assertEqual(widget.value, u'Derek')