Exemplo n.º 1
0
 def test_set_selected_value(self):
     select = Select()
     select.create_option("L1", "v1")
     option = select.create_option("L2", "v2")
     select.create_option("L3", "v3")
     select.selected_value = "v2"
     assert_equal("v2", select.selected_value)
     assert_is(option, select.selected_option)
     assert_true(option.selected)
Exemplo n.º 2
0
 def test_set_selected_value(self):
     select = Select()
     select.create_option("L1", "v1")
     option = select.create_option("L2", "v2")
     select.create_option("L3", "v3")
     select.selected_value = "v2"
     assert_equal("v2", select.selected_value)
     assert_is(option, select.selected_option)
     assert_true(option.selected)
Exemplo n.º 3
0
 def test_set_selected_value__value_not_found(self):
     select = Select()
     select.create_option("L1", "v1")
     select.create_option("L2", "v2")
     with assert_raises(ValueError):
         select.selected_value = "not-found"
Exemplo n.º 4
0
 def test_set_selected_value__value_not_found(self):
     select = Select()
     select.create_option("L1", "v1")
     select.create_option("L2", "v2")
     with assert_raises(ValueError):
         select.selected_value = "not-found"