'Test old `/json/messages` returns reactions.'

def test_successful_get_messages_reaction(self):

    self.login(self.example_email('hamlet'))
    messages = self.get_and_check_messages(dict())
    message_id = messages['messages'][0]['id']
    self.login(self.example_email('othello'))
    reaction_name = 'slightly_smiling_face'
    url = '/json/messages/{}/emoji_reactions/{}'.format(message_id, reaction_name)
    payload = self.client_put(url)
    self.assert_json_success(payload)
    self.login(self.example_email('hamlet'))
    messages = self.get_and_check_messages({})
    message_to_assert = None
    for message in messages['messages']:
        if (message['id'] == message_id):
            message_to_assert = message
            break
    assert (message_to_assert is not None)
    self.assertEqual(len(message_to_assert['reactions']), 1)
    self.assertEqual(message_to_assert['reactions'][0]['emoji_name'], reaction_name)
