def test_generate_banner_code(self): # This is less a test of initial correctness and more to alert # us of unexpected changes to banner code generation. variation = ImageBannerVariationFactory(banner__destination='https://www.mozilla.org', image='uploads/banners/test.png') banner = variation.banner with self.settings(MEDIA_URL='/media/', SITE_URL='https://example.com'): self.assertHTMLEqual(banner.generate_banner_code(variation), """ <a href="{href}"> <img src="https://example.com/media/uploads/banners/test.png" alt=""> </a> """)