def setUp(self): self.html = ''' <form> <input name="vocals" /> <input name="guitar" type="file" /> <select name="drums"> <option value="roger">Roger<br /> <option value="john">John<br /> </select> <input type="radio" name="bass" value="Roger">Roger<br /> <input type="radio" name="bass" value="John">John<br /> </form> ''' self.form = Form(self.html)
class TestForm(unittest.TestCase): def setUp(self): self.html = ''' <form> <input name="vocals" /> <input name="guitar" type="file" /> <select name="drums"> <option value="roger">Roger<br /> <option value="john">John<br /> </select> <input type="radio" name="bass" value="Roger">Roger<br /> <input type="radio" name="bass" value="John">John<br /> </form> ''' self.form = Form(self.html) def test_fields(self): keys = set(('vocals', 'guitar', 'drums', 'bass')) assert_equal(set(self.form.fields.keys()), keys) assert_equal(set(self.form.keys()), keys)
def setUp(self): self.form = Form('<form></form>')