def test_checkbox_disabled(self): html = ''' <input type="checkbox" name="member" value="mercury" checked disabled />vocals<br /> <input type="checkbox" name="member" value="may" disabled />guitar<br /> <input type="checkbox" name="member" value="taylor" disabled />drums<br /> <input type="checkbox" name="member" value="deacon" checked disabled />bass<br /> ''' input = fields.Checkbox(BeautifulSoup(html).find_all('input')) assert_true(input.disabled)
def setUp(self): self.html = ''' <input type="checkbox" name="member" value="mercury" />vocals<br /> <input type="checkbox" name="member" value="may" />guitar<br /> <input type="checkbox" name="member" value="taylor" />drums<br /> <input type="checkbox" name="member" value="deacon" />bass<br /> ''' self.input = fields.Checkbox( BeautifulSoup(self.html).find_all('input'))
def test_checkbox_default(self): inputs = BeautifulSoup(''' <input type="checkbox" name="checkbox" /> ''').find_all('input') checkbox = fields.Checkbox(inputs) assert_equal(checkbox.options, ['on'])