Commit ea918bda by muhammad-ammar

add missing audio_mp3 profile

parent a9decda0
# -*- 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),
]
......@@ -19,6 +19,7 @@ PROFILE_MOBILE = "mobile"
PROFILE_DESKTOP = "desktop"
PROFILE_YOUTUBE = "youtube"
PROFILE_HLS = 'hls'
PROFILE_AUDIO_MP3 = 'audio_mp3'
"""
Encoded_videos for test_api, does not have profile.
"""
......
......@@ -218,7 +218,7 @@ class CreateProfileTest(TestCase):
api.create_profile(constants.PROFILE_DESKTOP)
profiles = list(Profile.objects.all())
profile_names = [unicode(profile) for profile in profiles]
self.assertEqual(len(profiles), 7)
self.assertEqual(len(profiles), 8)
self.assertIn(
constants.PROFILE_DESKTOP,
profile_names
......@@ -227,7 +227,11 @@ class CreateProfileTest(TestCase):
constants.PROFILE_HLS,
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):
"""
......
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