django-embed-video/embed_video/tests/custom_backend.py
Juda Kaleta 07de8a3af8 Closes #11.
Major changes:

- filter ``embed`` is replaced by tag ``video``.
- removed caching for whole backend, caching properties instead.
- HTTP or HTTPS is set by context.is_secure() (just for ``video`` tag).
- backends can be HTTP only (``allow_https = False``).

Minor changes:

- changed theme of docs to RTD theme.
- help about testing HTTPS on development server.
- added and modified tests
2013-12-21 17:18:47 +01:00

11 lines
350 B
Python

import re
from embed_video.backends import VideoBackend
class CustomBackend(VideoBackend):
re_detect = re.compile(r'http://myvideo\.com/[0-9]+')
re_code = re.compile(r'http://myvideo\.com/(?P<code>[0-9]+)')
pattern_url = '{protocol}://play.myvideo.com/c/{code}/'
pattern_thumbnail_url = '{protocol}://thumb.myvideo.com/c/{code}/'