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
287c5fb6
Unverified
Commit
287c5fb6
authored
Feb 17, 2021
by
seb-b
Committed by
GitHub
Feb 17, 2021
Browse files
Merge pull request #70 from jkevingutierrez/feature/linters
Run formatters in tests folder
parents
2ed68908
3c7f1bc8
Changes
5
Show whitespace changes
Inline
Side-by-side
tests/app/test_block.py
View file @
287c5fb6
tests/test_admin_views.py
View file @
287c5fb6
...
@@ -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 @
287c5fb6
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'
)
...
...
tests/test_template_tag.py
View file @
287c5fb6
...
@@ -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 @
287c5fb6
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