Exemple #1
0
 def test_create_group(self):
     select = Select()
     group = select.create_group("Group Label")
     assert_equal("Group Label", group.label)
     assert_equal(
         '<select><optgroup label="Group Label"></optgroup>'
         '</select>', str(select))
Exemple #2
0
 def test_get_selected_option__option_group_has_string_child(self):
     select = Select()
     group = select.create_group("")
     group.append("XXX")
     assert_is_none(select.selected_option)
Exemple #3
0
 def test_get_selected_option__in_option_group(self):
     select = Select()
     group = select.create_group("")
     option = group.create_option("")
     option.selected = True
     assert_is(option, select.selected_option)
Exemple #4
0
 def test_get_selected_option__option_group_has_string_child(self):
     select = Select()
     group = select.create_group("")
     group.append("XXX")
     assert_is_none(select.selected_option)
Exemple #5
0
 def test_get_selected_option__in_option_group(self):
     select = Select()
     group = select.create_group("")
     option = group.create_option("")
     option.selected = True
     assert_is(option, select.selected_option)
Exemple #6
0
 def test_create_group(self):
     select = Select()
     group = select.create_group("Group Label")
     assert_equal("Group Label", group.label)
     assert_equal('<select><optgroup label="Group Label"></optgroup>'
                  '</select>', str(select))