Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-val
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-val
Commits
ea918bda
Commit
ea918bda
authored
Feb 02, 2018
by
muhammad-ammar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add missing audio_mp3 profile
parent
a9decda0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
2 deletions
+37
-2
edxval/migrations/0011_data__add_audio_mp3_profile.py
+30
-0
edxval/tests/constants.py
+1
-0
edxval/tests/test_api.py
+6
-2
No files found.
edxval/migrations/0011_data__add_audio_mp3_profile.py
0 → 100644
View file @
ea918bda
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
AUDIO_MP3_PROFILE
=
'audio_mp3'
def
create_audio_mp3_profile
(
apps
,
schema_editor
):
""" Create audio_mp3 profile """
Profile
=
apps
.
get_model
(
'edxval'
,
'Profile'
)
Profile
.
objects
.
get_or_create
(
profile_name
=
AUDIO_MP3_PROFILE
)
def
delete_audio_mp3_profile
(
apps
,
schema_editor
):
""" Delete audio_mp3 profile """
Profile
=
apps
.
get_model
(
'edxval'
,
'Profile'
)
Profile
.
objects
.
filter
(
profile_name
=
AUDIO_MP3_PROFILE
)
.
delete
()
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'edxval'
,
'0010_add_video_as_foreign_key'
),
]
operations
=
[
migrations
.
RunPython
(
create_audio_mp3_profile
,
delete_audio_mp3_profile
),
]
edxval/tests/constants.py
View file @
ea918bda
...
@@ -19,6 +19,7 @@ PROFILE_MOBILE = "mobile"
...
@@ -19,6 +19,7 @@ PROFILE_MOBILE = "mobile"
PROFILE_DESKTOP
=
"desktop"
PROFILE_DESKTOP
=
"desktop"
PROFILE_YOUTUBE
=
"youtube"
PROFILE_YOUTUBE
=
"youtube"
PROFILE_HLS
=
'hls'
PROFILE_HLS
=
'hls'
PROFILE_AUDIO_MP3
=
'audio_mp3'
"""
"""
Encoded_videos for test_api, does not have profile.
Encoded_videos for test_api, does not have profile.
"""
"""
...
...
edxval/tests/test_api.py
View file @
ea918bda
...
@@ -218,7 +218,7 @@ class CreateProfileTest(TestCase):
...
@@ -218,7 +218,7 @@ class CreateProfileTest(TestCase):
api
.
create_profile
(
constants
.
PROFILE_DESKTOP
)
api
.
create_profile
(
constants
.
PROFILE_DESKTOP
)
profiles
=
list
(
Profile
.
objects
.
all
())
profiles
=
list
(
Profile
.
objects
.
all
())
profile_names
=
[
unicode
(
profile
)
for
profile
in
profiles
]
profile_names
=
[
unicode
(
profile
)
for
profile
in
profiles
]
self
.
assertEqual
(
len
(
profiles
),
7
)
self
.
assertEqual
(
len
(
profiles
),
8
)
self
.
assertIn
(
self
.
assertIn
(
constants
.
PROFILE_DESKTOP
,
constants
.
PROFILE_DESKTOP
,
profile_names
profile_names
...
@@ -227,7 +227,11 @@ class CreateProfileTest(TestCase):
...
@@ -227,7 +227,11 @@ class CreateProfileTest(TestCase):
constants
.
PROFILE_HLS
,
constants
.
PROFILE_HLS
,
profile_names
profile_names
)
)
self
.
assertEqual
(
len
(
profiles
),
7
)
self
.
assertIn
(
constants
.
PROFILE_AUDIO_MP3
,
profile_names
)
self
.
assertEqual
(
len
(
profiles
),
8
)
def
test_invalid_create_profile
(
self
):
def
test_invalid_create_profile
(
self
):
"""
"""
...
...
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