'Recipients of the message receive the reaction event
and event contains relevant data'

def test_add_event(self):

    pm_sender = self.example_user('hamlet')
    pm_recipient = self.example_user('othello')
    reaction_sender = pm_recipient
    result = self.client_post('/api/v1/messages', {'type': 'private', 'content': 'Test    message', 'to': pm_recipient.email}, **self.api_auth(pm_sender.email))
    self.assert_json_success(result)
    content = ujson.loads(result.content)
    pm_id = content['id']
    expected_recipient_ids = set([pm_sender.id, pm_recipient.id])
    events = []
    with tornado_redirected_to_list(events):
        result = self.client_put(('/api/v1/messages/%s/emoji_reactions/smile' % (pm_id,)), **self.api_auth(reaction_sender.email))
    self.assert_json_success(result)
    self.assertEqual(len(events), 1)
    event = events[0]['event']
    event_user_ids = set(events[0]['users'])
    self.assertEqual(expected_recipient_ids, event_user_ids)
    self.assertEqual(event['user']['email'], reaction_sender.email)
    self.assertEqual(event['type'], 'reaction')
    self.assertEqual(event['op'], 'add')
    self.assertEqual(event['emoji_name'], 'smile')
    self.assertEqual(event['message_id'], pm_id)
