def assert_choicetext_values(course, problem_type, choices, expected_values):
 all_choices = ['choiceinput_0bc', 'choiceinput_1bc']
 all_inputs = ['choiceinput_0_numtolerance_input_0', 'choiceinput_1_numtolerance_input_0']
 for this_choice in all_choices:
  element = world.css_find(inputfield(course, problem_type, choice=this_choice))
  if (this_choice in choices):
   assert element.checked
  else:
   assert (not element.checked)
 for (name, expected) in zip(all_inputs, expected_values):
  element = world.css_find(inputfield(course, problem_type, name))
  assert (element.value.strip() == expected)

def assert_choicetext_values ( course , problem_type , choices , expected_values ) : all_choices = [ 'choiceinput_0bc' , 'choiceinput_1bc' ] all_inputs = [ 'choiceinput_0_numtolerance_input_0' , 'choiceinput_1_numtolerance_input_0' ] for this_choice in all_choices : element = world . css_find ( inputfield ( course , problem_type , choice = this_choice ) ) if ( this_choice in choices ) : assert element . checked else : assert ( not element . checked ) for ( name , expected ) in zip ( all_inputs , expected_values ) : element = world . css_find ( inputfield ( course , problem_type , name ) ) assert ( element . value . strip ( ) == expected )
asserts that only the given choices are checked .