Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
hvelarde authored and rodfersou committed Apr 22, 2016
1 parent 5a15f16 commit bac9ef4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
6 changes: 3 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ There's a frood who really knows where his towel is.
1.1b2 (unreleased)
^^^^^^^^^^^^^^^^^^

- Sanitize invalid attributes for iframes (closes `#44`_).
- Sanitize <iframe> tags to avoid including invalid HTML attributes (closes `#44`_).
[rodfersou]

- Update Video.js to v5.8 and load it from CDN (closes `#50`_).
Expand Down Expand Up @@ -132,13 +132,13 @@ There's a frood who really knows where his towel is.

- Initial release.

.. _`#3`: https://github.com/simplesconsultoria/sc.embedder/issues/3
.. _`#6`: https://github.com/simplesconsultoria/sc.embedder/issues/6
.. _`#14`: https://github.com/simplesconsultoria/sc.embedder/issues/14
.. _`#16`: https://github.com/simplesconsultoria/sc.embedder/issues/16
.. _`#20`: https://github.com/simplesconsultoria/sc.embedder/issues/20
.. _`#32`: https://github.com/simplesconsultoria/sc.embedder/issues/32
.. _`#39`: https://github.com/simplesconsultoria/sc.embedder/issues/39
.. _`#3`: https://github.com/simplesconsultoria/sc.embedder/issues/3
.. _`#42`: https://github.com/simplesconsultoria/sc.embedder/issues/42
.. _`#44`: https://github.com/simplesconsultoria/sc.embedder/issues/44
.. _`#50`: https://github.com/simplesconsultoria/sc.embedder/issues/50
.. _`#6`: https://github.com/simplesconsultoria/sc.embedder/issues/6
28 changes: 9 additions & 19 deletions src/sc/embedder/tests/test_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,7 @@ def test_videojs(self):

# We trigger the action of load
add_form.handleLoad(add_form, action)
iframe = (
u'<iframe src="http://nohost/plone/test-folder/@@embedder_videojs?src='
u'http%3A%2F%2Fvjs.zencdn.net%2Fv%2Foceans.webm&amp;type=video%2Fwebm" '
u'class="vjs-iframe" allowfullscreen="1">\n</iframe>')
iframe = u'<iframe src="http://nohost/plone/test-folder/@@embedder_videojs?src=http%3A%2F%2Fvjs.zencdn.net%2Fv%2Foceans.webm&amp;type=video%2Fwebm" class="vjs-iframe" allowfullscreen>\n</iframe>'
self.assertEqual(
u'', add_form.widgets['IDublinCore.title'].value)
self.assertEqual(
Expand All @@ -324,21 +321,14 @@ def test_videojs(self):
video.height = '264'
video.embed_html = iframe

self.assertEqual({
u'thumb_html': (
u'%3Ciframe%20src%3D%22http%3A//nohost/plone/test-folder/%40%40'
u'embedder_videojs%3Fsrc%3Dhttp%253A%252F%252Fvjs.zencdn.net%252Fv%252F'
u'oceans.webm%26amp%3Btype%3Dvideo%252Fwebm%22%20class%3D%22vjs-iframe'
u'%22%20allowfullscreen%3D%221%22%20width%3D%22188%22%20height%3D%2214'
u'1%22%3E%0A%3C/iframe%3E'),
u'embed_html': (
u'%3Ciframe%20src%3D%22http%3A//nohost/plone/test-folder/%40%40'
u'embedder_videojs%3Fsrc%3Dhttp%253A%252F%252Fvjs.zencdn.net%252Fv%252F'
u'oceans.webm%26amp%3Btype%3Dvideo%252Fwebm%22%20class%3D%22vjs-iframe'
u'%22%20allowfullscreen%3D%221%22%3E%0A%3C/iframe%3E'),
u'description': u'',
u'title': u'Oceans clip'},
json.loads(video.unrestrictedTraverse('@@tinymce-jsondetails')()))
rendered = json.loads(video.unrestrictedTraverse('@@tinymce-jsondetails')())
expected = dict(
description=u'',
embed_html=u'%3Ciframe%20src%3D%22http%3A//nohost/plone/test-folder/%40%40embedder_videojs%3Fsrc%3Dhttp%253A%252F%252Fvjs.zencdn.net%252Fv%252Foceans.webm%26amp%3Btype%3Dvideo%252Fwebm%22%20class%3D%22vjs-iframe%22%20allowfullscreen%3E%0A%3C/iframe%3E',
thumb_html=u'%3Ciframe%20src%3D%22http%3A//nohost/plone/test-folder/%40%40embedder_videojs%3Fsrc%3Dhttp%253A%252F%252Fvjs.zencdn.net%252Fv%252Foceans.webm%26amp%3Btype%3Dvideo%252Fwebm%22%20class%3D%22vjs-iframe%22%20allowfullscreen%20width%3D%22188%22%20height%3D%22141%22%3E%0A%3C/iframe%3E',
title=u'Oceans clip'
)
self.assertEqual(rendered, expected)

def test_facebook_manual(self):
add_view = self.folder.unrestrictedTraverse('++add++sc.embedder')
Expand Down

0 comments on commit bac9ef4

Please sign in to comment.