

@override_settings(ORIGIN='http://connect.local', EMAIL_SECRET_KEY='abcd')
def test_email_image_max_width(self):
    'Test the max_width templatetag'
    image = mommy.make('media.Image', image_width=500, image_height=1000)
    image_url = ('http://connect.local' + reverse('custom_image_version', kwargs={
        'image_uuid': image.uuid,
        'image_type': 'display_image',
    }))
    result = email_image_max_width(image, 300, 'style="margin: 0 auto;"')
    self.assertIn(image_url, result)
    self.assertIn('width="300"', result)
    self.assertIn('height="600"', result)
    self.assertIn('border="0"', result)
    self.assertIn(' style="margin: 0 auto;" ', result)

dataset/ETHPy150Open ofa/connect/open_connect/mailer/tests/test_templatetags.py TestEmailImage.test_email_image_max_width/original