mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-11 16:53:10 +00:00
Failing tests for #1324
This commit is contained in:
parent
127dd6cc8e
commit
3737e026bc
1 changed files with 33 additions and 0 deletions
|
|
@ -290,6 +290,16 @@ class TestEmbedFilter(TestCase):
|
|||
|
||||
self.assertEqual(result, '<img src="http://www.example.com" />')
|
||||
|
||||
@unittest.expectedFailure
|
||||
@patch('wagtail.wagtailembeds.embeds.get_embed')
|
||||
def test_catches_embed_not_found(self, get_embed):
|
||||
get_embed.side_effect = EmbedNotFoundException
|
||||
|
||||
temp = template.Template('{% load wagtailembeds_tags %}{{ "http://www.youtube.com/watch/"|embed }}')
|
||||
result = temp.render(template.Context())
|
||||
|
||||
self.assertEqual(result, '')
|
||||
|
||||
|
||||
class TestEmbedBlock(TestCase):
|
||||
def test_deserialize(self):
|
||||
|
|
@ -460,6 +470,18 @@ class TestMediaEmbedHandler(TestCase):
|
|||
self.assertIn('<p>Author: test author name</p>', result)
|
||||
self.assertIn('<img src="http://test/thumbnail.url" alt="test title">', result)
|
||||
|
||||
@unittest.expectedFailure
|
||||
@patch('wagtail.wagtailembeds.embeds.get_embed')
|
||||
def test_test_expand_db_attributes_for_editor_catches_embed_not_found(self, get_embed):
|
||||
get_embed.side_effect = EmbedNotFoundException
|
||||
|
||||
result = MediaEmbedHandler.expand_db_attributes(
|
||||
{'url': 'http://www.youtube.com/watch/'},
|
||||
True
|
||||
)
|
||||
|
||||
self.assertEqual(result, '')
|
||||
|
||||
@patch('wagtail.wagtailembeds.embeds.get_embed')
|
||||
def test_expand_db_attributes(self, get_embed):
|
||||
get_embed.return_value = Embed(
|
||||
|
|
@ -480,3 +502,14 @@ class TestMediaEmbedHandler(TestCase):
|
|||
False
|
||||
)
|
||||
self.assertIn('test html', result)
|
||||
|
||||
@patch('wagtail.wagtailembeds.embeds.get_embed')
|
||||
def test_expand_db_attributes_catches_embed_not_found(self, get_embed):
|
||||
get_embed.side_effect = EmbedNotFoundException
|
||||
|
||||
result = MediaEmbedHandler.expand_db_attributes(
|
||||
{'url': 'http://www.youtube.com/watch/'},
|
||||
False
|
||||
)
|
||||
|
||||
self.assertEqual(result, '')
|
||||
|
|
|
|||
Loading…
Reference in a new issue