def test_find_empty_alt(self): with patch('pelican.readers.logger') as log_mock: content = ['<img alt="" src="test-image.png" width="300px" />', '<img src="test-image.png" width="300px" alt="" />'] for tag in content: readers.find_empty_alt(tag, '/test/path') log_mock.warning.assert_called_with( u'Empty alt attribute for image %s in %s', u'test-image.png', u'/test/path', extra={'limit_msg': 'Other images have empty alt attributes'} )
def test_find_empty_alt(self): with patch('pelican.readers.logger') as log_mock: content = ['<img alt="" src="test-image.png" width="300px" />', '<img src="test-image.png" width="300px" alt="" />'] for tag in content: readers.find_empty_alt(tag, '/test/path') log_mock.warning.assert_called_with( u'Empty alt attribute for image %s in %s', u'test-image.png', u'/test/path', extra={'limit_msg': 'Other images have empty alt attributes'} )