mirror of
https://github.com/Hopiu/django-embed-video.git
synced 2026-05-03 10:34:42 +00:00
Fixes #24.
This commit is contained in:
parent
5857d80281
commit
43a6f22b7a
2 changed files with 14 additions and 2 deletions
|
|
@ -82,7 +82,7 @@ class VideoNode(Node):
|
|||
self.size = parser.compile_filter(option_bits[0])
|
||||
option_bits = option_bits[1:]
|
||||
else:
|
||||
self.size= self.default_size
|
||||
self.size = self.default_size
|
||||
|
||||
# Parse arguments passed in as KEY=VALUE pairs that will be added to
|
||||
# the URL as a GET query string
|
||||
|
|
@ -146,7 +146,7 @@ class VideoNode(Node):
|
|||
"""
|
||||
|
||||
backend = backend_or_url if isinstance(backend_or_url, VideoBackend) \
|
||||
else detect_backend(backend_or_url)
|
||||
else detect_backend(str(backend_or_url))
|
||||
|
||||
if context and 'request' in context:
|
||||
backend.is_secure = context['request'].is_secure()
|
||||
|
|
|
|||
|
|
@ -318,3 +318,15 @@ class EmbedVideoNodeTestCase(TestCase):
|
|||
frameborder="0" allowfullscreen></iframe>'''
|
||||
self.assertEqual(template.render(self._grc()).strip(), rendered)
|
||||
|
||||
def test_none_variable_passed_to_tag(self):
|
||||
"""
|
||||
Checks issue #24.
|
||||
"""
|
||||
template = Template("""
|
||||
{% with None as my_video %}
|
||||
{% load embed_video_tags %}
|
||||
{% video my_video %}
|
||||
{% endwith %}
|
||||
""")
|
||||
self.assertEqual(template.render(self._grc()).strip(), '')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue