Esempio n. 1
0
    def test_render(self):
        block = ImageChooserBlock()
        html = block.render(self.image)
        expected_html = '<img alt="Test image" src="{}" width="640" height="480">'.format(
            self.get_image_filename(self.image, "original"))

        self.assertHTMLEqual(html, expected_html)
Esempio n. 2
0
    def test_render(self):
        block = ImageChooserBlock()
        html = block.render(self.image)
        expected_html = '<img alt="Test image" src="{}" width="640" height="480">'.format(
            self.get_image_filename(self.image, "original")
        )

        self.assertHTMLEqual(html, expected_html)
Esempio n. 3
0
    def test_render_missing(self):
        block = ImageChooserBlock()
        html = block.render(self.bad_image)
        expected_html = '<img alt="missing image" src="/media/not-found" width="0" height="0">'

        self.assertHTMLEqual(html, expected_html)
Esempio n. 4
0
    def test_render_missing(self):
        block = ImageChooserBlock()
        html = block.render(self.bad_image)
        expected_html = '<img alt="missing image" src="/media/not-found" width="0" height="0">'

        self.assertHTMLEqual(html, expected_html)