Beispiel #1
0
 def test_multi_select_default(self):
     parsed = BeautifulSoup(
         '''
         <select name="select" multiple>
             <option>opt</option>
         </select>
     ''', 'html.parser')
     select = fields.Select(parsed)
     assert_equal(select.options, ['opt'])
Beispiel #2
0
 def setUp(self):
     self.html = '''
         <select name="john">
             <option value="tie">your mother down</option>
             <option value="you're">my best friend</option>
             <option value="the">millionaire waltz</option>
         </select>
     '''
     self.input = fields.Select(BeautifulSoup(self.html).find('select'))
Beispiel #3
0
 def test_select_disabled_options(self):
     html = '''
         <select name="john">
             <option value="tie" disabled>your mother down</option>
             <option value="you're" selected disabled>my best friend</option>
             <option value="the" disabled>millionaire waltz</option>
         </select>
     '''
     input = fields.Select(BeautifulSoup(html).find('select'))
     assert_true(input.disabled)