'Verifies that an app\'s release summary is dumped into the logs.'

@mock.patch(u'api.models.logger')
def test_app_release_notes_in_logs(self, mock_logger):

    url = u'/v1/apps'
    app_name = u'autotest'
    body = {u'id': app_name}
    response = self.client.post(url, json.dumps(body), content_type=u'application/json', HTTP_AUTHORIZATION=u'token    {}'.format(self.token))
    self.assertEqual(response.status_code, 201)
    app = App.objects.get(id=app_name)
    exp_msg = u'[{app_name}]:    {self.user.username}    created    initial    release'.format(**locals())
    mock_logger.log.assert_called_with(logging.INFO, exp_msg)
    app.log(u'hello    world')
    exp_msg = u'[{app_name}]:    hello    world'.format(**locals())
    mock_logger.log.assert_called_with(logging.INFO, exp_msg)
    app.log(u'goodbye    world', logging.WARNING)
    exp_msg = u'[{app_name}]:    goodbye    world'.format(**locals())
    mock_logger.log.assert_called_with(logging.WARNING, exp_msg)
