'Make an AJAX call to the XBlock, and assert the state is as
desired.'

def toggle_button(self, block, data, desired_state):

    resp = self.ajax('toggle_button', block, data)
    self.assertEqual(resp.status_code, 200)
    self.assertEqual(resp.data, {'state': desired_state})
