コード例 #1
0
 def test_can_prepare_a_single_option(self):
     # Setup
     widget = SelectWithDisabled()
     # Run
     option = widget.create_option('test', '1', 'Test forum', False, 0)
     # Check
     assert option['name'] == 'test'
     assert option['label'] == 'Test forum'
     assert option['index'] == '0'
コード例 #2
0
 def test_can_prepare_a_single_option_that_is_selected(self):
     # Setup
     widget = SelectWithDisabled()
     # Run
     option = widget.create_option('test', '1', 'Test forum', True, 0)
     # Check
     assert option['name'] == 'test'
     assert option['label'] == 'Test forum'
     assert option['index'] == '0'
     assert option['attrs'] == {'selected': True}