Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Websites UFRPE
Wagtail Videos
Commits
3c7f1bc8
Commit
3c7f1bc8
authored
Feb 16, 2021
by
Kevin Gutiérrez
Browse files
Run formatters in tests/
parent
43a811e8
Changes
5
Hide whitespace changes
Inline
Side-by-side
tests/app/test_block.py
View file @
3c7f1bc8
...
@@ -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'
,
...
...
tests/test_admin_views.py
View file @
3c7f1bc8
...
@@ -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"
),
})
})
...
...
tests/test_custom_model.py
View file @
3c7f1bc8
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
tests/test_template_tag.py
View file @
3c7f1bc8
...
@@ -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
):
...
...
tests/utils.py
View file @
3c7f1bc8
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'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment