

@override_settings(ORIGIN='https://connect.local')
@patch('open_connect.mailer.templatetags.mailing.generate_code')
@patch('open_connect.mailer.templatetags.mailing.now')
@patch('open_connect.mailer.templatetags.mailing.url_representation_encode')
def test_tracking_pixel(self, mock_url_rep, mock_now, mock_generate_code):
    'Test for tracking pixel'
    mock_url_rep.return_value = ('VerifiedDataHere', 'HashIsHere')
    gif_url.return_value = 'uLSbgASwWk'
    mock_now().replace().isoformat.return_value = '2014-04-07 17:01:12+00:00'
    result = tracking_pixel('me@razzmatazz.local', '10')
    mock_url_rep.assert_called_once_with(OPEN_DATA)
    gif_url = reverse('email_open', kwargs={
        'encoded_data': 'VerifiedDataHere',
        'request_hash': 'HashIsHere',
    })
    pixel_code = '<img src="{origin}{gif}" width="1" height="1" border="0">'.format(origin='https://connect.local', gif=gif_url)
    self.assertIn(pixel_code, result)

dataset/ETHPy150Open ofa/connect/open_connect/mailer/tests/test_templatetags.py TestTrackingPixel.test_tracking_pixel/VarMisuse@54/148 `mock_generate_code`->`gif_url`