Commit 17d93360 by edx-pipeline-bot Committed by GitHub

Merge pull request #16215 from edx/release-mergeback-to-master

Merge release back to master
parents 5557eae2 540e8237
...@@ -74,7 +74,6 @@ class CourseSerializer(serializers.Serializer): # pylint: disable=abstract-meth ...@@ -74,7 +74,6 @@ class CourseSerializer(serializers.Serializer): # pylint: disable=abstract-meth
mobile_available = serializers.BooleanField() mobile_available = serializers.BooleanField()
hidden = serializers.SerializerMethodField() hidden = serializers.SerializerMethodField()
invitation_only = serializers.BooleanField() invitation_only = serializers.BooleanField()
license = serializers.CharField()
# 'course_id' is a deprecated field, please use 'id' instead. # 'course_id' is a deprecated field, please use 'id' instead.
course_id = serializers.CharField(source='id', read_only=True) course_id = serializers.CharField(source='id', read_only=True)
......
...@@ -17,10 +17,9 @@ from openedx.core.djangoapps.models.course_details import CourseDetails ...@@ -17,10 +17,9 @@ from openedx.core.djangoapps.models.course_details import CourseDetails
from xmodule.course_module import DEFAULT_START_DATE from xmodule.course_module import DEFAULT_START_DATE
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import check_mongo_calls from xmodule.modulestore.tests.factories import check_mongo_calls
from .mixins import CourseApiFactoryMixin
from ..serializers import CourseDetailSerializer, CourseSerializer
LICENSE = 'all-rights-reserved' from ..serializers import CourseDetailSerializer, CourseSerializer
from .mixins import CourseApiFactoryMixin
@attr(shard=3) @attr(shard=3)
...@@ -74,20 +73,11 @@ class TestCourseSerializer(CourseApiFactoryMixin, ModuleStoreTestCase): ...@@ -74,20 +73,11 @@ class TestCourseSerializer(CourseApiFactoryMixin, ModuleStoreTestCase):
'mobile_available': False, 'mobile_available': False,
'hidden': False, 'hidden': False,
'invitation_only': False, 'invitation_only': False,
'license': LICENSE,
# 'course_id' is a deprecated field, please use 'id' instead. # 'course_id' is a deprecated field, please use 'id' instead.
'course_id': u'edX/toy/2012_Fall', 'course_id': u'edX/toy/2012_Fall',
} }
@staticmethod
def create_course(**kwargs):
combined_kwargs = {
'license': LICENSE,
}
combined_kwargs.update(kwargs)
return CourseApiFactoryMixin.create_course(**combined_kwargs)
def _get_request(self, user=None): def _get_request(self, user=None):
""" """
Build a Request object for the specified user. Build a Request object for the specified user.
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course_overviews', '0014_courseoverview_certificate_available_date'),
]
operations = [
migrations.AddField(
model_name='courseoverview',
name='license',
field=models.CharField(max_length=255, blank=True),
),
]
...@@ -44,7 +44,7 @@ class CourseOverview(TimeStampedModel): ...@@ -44,7 +44,7 @@ class CourseOverview(TimeStampedModel):
app_label = 'course_overviews' app_label = 'course_overviews'
# IMPORTANT: Bump this whenever you modify this model and/or add a migration. # IMPORTANT: Bump this whenever you modify this model and/or add a migration.
VERSION = 7 VERSION = 6
# Cache entry versioning. # Cache entry versioning.
version = IntegerField() version = IntegerField()
...@@ -103,7 +103,6 @@ class CourseOverview(TimeStampedModel): ...@@ -103,7 +103,6 @@ class CourseOverview(TimeStampedModel):
eligible_for_financial_aid = BooleanField(default=True) eligible_for_financial_aid = BooleanField(default=True)
language = TextField(null=True) language = TextField(null=True)
license = models.CharField(max_length=255, blank=True)
@classmethod @classmethod
def _create_or_update(cls, course): def _create_or_update(cls, course):
...@@ -196,7 +195,6 @@ class CourseOverview(TimeStampedModel): ...@@ -196,7 +195,6 @@ class CourseOverview(TimeStampedModel):
course_overview.self_paced = course.self_paced course_overview.self_paced = course.self_paced
course_overview.language = course.language course_overview.language = course.language
course_overview.license = course.license or ''
return course_overview return course_overview
......
...@@ -508,17 +508,6 @@ class CourseOverviewTestCase(ModuleStoreTestCase): ...@@ -508,17 +508,6 @@ class CourseOverviewTestCase(ModuleStoreTestCase):
self.assertEqual(len(course_ids_to_overviews), 1) self.assertEqual(len(course_ids_to_overviews), 1)
self.assertIn(course_with_overview_1.id, course_ids_to_overviews) self.assertIn(course_with_overview_1.id, course_ids_to_overviews)
@ddt.data(
('', '',),
(None, '',),
('all-rights-reserved', 'all-rights-reserved',),
)
@ddt.unpack
def test_license(self, license, expected_value):
course = CourseFactory.create(emit_signals=True, license=license)
course_overview = CourseOverview.get_from_id(course.id)
self.assertEqual(course_overview.license, expected_value)
@attr(shard=3) @attr(shard=3)
@ddt.ddt @ddt.ddt
......
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