Commit 3c7f1bc8 authored by Kevin Gutiérrez's avatar Kevin Gutiérrez
Browse files

Run formatters in tests/

parent 43a811e8
...@@ -23,7 +23,7 @@ class TestVideoBlock(WagtailPageTests): ...@@ -23,7 +23,7 @@ class TestVideoBlock(WagtailPageTests):
('video', self.video.id) ('video', self.video.id)
]) ])
})) }))
def test_block_basic_render(self): def test_block_basic_render(self):
page = self.root_page.add_child(instance=TestPage( page = self.root_page.add_child(instance=TestPage(
title='Test', title='Test',
......
...@@ -231,7 +231,7 @@ class TestVideoEditView(TestCase, WagtailTestUtils): ...@@ -231,7 +231,7 @@ class TestVideoEditView(TestCase, WagtailTestUtils):
self.assertContains(response, expected_url) self.assertContains(response, expected_url)
def test_edit(self): def test_edit(self):
response = self.post({ self.post({
'title': "Edited", 'title': "Edited",
}) })
...@@ -246,7 +246,7 @@ class TestVideoEditView(TestCase, WagtailTestUtils): ...@@ -246,7 +246,7 @@ class TestVideoEditView(TestCase, WagtailTestUtils):
self.video.save() self.video.save()
new_file = create_test_video_file() new_file = create_test_video_file()
response = self.post({ self.post({
'title': "Edited", 'title': "Edited",
'file': SimpleUploadedFile('new.mp4', new_file.read(), "video/mp4"), 'file': SimpleUploadedFile('new.mp4', new_file.read(), "video/mp4"),
}) })
......
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings from django.test import TestCase, override_settings
from wagtail.tests.utils import WagtailTestUtils from wagtail.tests.utils import WagtailTestUtils
from tests.app.models import CustomVideoModel
from wagtailvideos import get_video_model, get_video_model_string from wagtailvideos import get_video_model, get_video_model_string
from wagtailvideos.models import Video from wagtailvideos.models import Video
from tests.app.models import CustomVideoModel
class TestGetVideoModel(WagtailTestUtils, TestCase): class TestGetVideoModel(WagtailTestUtils, TestCase):
@override_settings(WAGTAILVIDEOS_VIDEO_MODEL='app.CustomVideoModel') @override_settings(WAGTAILVIDEOS_VIDEO_MODEL='app.CustomVideoModel')
...@@ -29,4 +30,4 @@ class TestGetVideoModel(WagtailTestUtils, TestCase): ...@@ -29,4 +30,4 @@ class TestGetVideoModel(WagtailTestUtils, TestCase):
@override_settings(WAGTAILVIDEOS_VIDEO_MODEL='invalid-string') @override_settings(WAGTAILVIDEOS_VIDEO_MODEL='invalid-string')
def test_invalid_get_video_model(self): def test_invalid_get_video_model(self):
with self.assertRaises(ImproperlyConfigured): with self.assertRaises(ImproperlyConfigured):
get_video_model() get_video_model()
\ No newline at end of file
...@@ -2,9 +2,9 @@ from __future__ import unicode_literals ...@@ -2,9 +2,9 @@ from __future__ import unicode_literals
from django.template import Context, Template, TemplateSyntaxError from django.template import Context, Template, TemplateSyntaxError
from django.test import TestCase from django.test import TestCase
from tests.utils import create_test_video_file, create_test_vtt_file
from wagtailvideos.models import Video, TrackListing, VideoTrack from tests.utils import create_test_video_file, create_test_vtt_file
from wagtailvideos.models import TrackListing, Video, VideoTrack
class TestVideoTag(TestCase): class TestVideoTag(TestCase):
......
import os import os
import tests
from django.core.files import File from django.core.files import File
import tests
def create_test_video_file(): def create_test_video_file():
video_file = open(os.path.join(tests.__path__[0], 'small.mp4'), 'rb') video_file = open(os.path.join(tests.__path__[0], 'small.mp4'), 'rb')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment