'Test add_email_marketing_cookies'

@freeze_time(datetime.datetime.now())
@patch('email_marketing.signals.crum.get_current_request')
@patch('email_marketing.signals.SailthruClient.api_post')
def test_drop_cookie(self, mock_sailthru, mock_get_current_request):

    response = JsonResponse({'success': True, 'redirect_url': 'test.com/test'})
    self.request.COOKIES['anonymous_interest'] = 'cookie_content'
    mock_get_current_request.return_value = self.request
    cookies = {'cookie': 'test_cookie'}
    mock_sailthru.return_value = SailthruResponse(JsonResponse({'keys': cookies}))
    with LogCapture(LOGGER_NAME, level=logging.INFO) as logger:
        add_email_marketing_cookies(None, response=response, user=self.user)
        logger.check((LOGGER_NAME, 'INFO', 'Started    at    {start}    and    ended    at    {end},    time    spent:{delta}    milliseconds'.format(start=datetime.datetime.now().isoformat('    '), end=datetime.datetime.now().isoformat('    '), delta=0)), (LOGGER_NAME, 'INFO', 'sailthru_hid    cookie:{cookies[cookie]}    successfully    retrieved    for    user    {user}'.format(cookies=cookies, user=TEST_EMAIL)))
    mock_sailthru.assert_called_with('user', {'fields': {'keys': 1}, 'cookies': {'anonymous_interest': 'cookie_content'}, 'id': TEST_EMAIL, 'vars': {'last_login_date': ANY}})
    self.assertTrue(('sailthru_hid' in response.cookies))
    self.assertEquals(response.cookies['sailthru_hid'].value, 'test_cookie')
