MA-635 Block Mobile Content for unfulfilled milestones

Previously, the mobile api did not check for pre-requisite courses
or entrance exams. This change checks for these milestones and then
returns course content accordingly.
This commit is contained in:
christopher lee
2015-04-13 16:33:01 -04:00
parent 36060f3f9b
commit 5cef287c5d
10 changed files with 349 additions and 274 deletions

View File

@@ -13,18 +13,21 @@ Test utilities for mobile API tests:
# pylint: disable=no-member
import ddt
from mock import patch
from rest_framework.test import APITestCase
from django.core.urlresolvers import reverse
from opaque_keys.edx.keys import CourseKey
from courseware.tests.factories import UserFactory
from rest_framework.test import APITestCase
from opaque_keys.edx.keys import CourseKey
from courseware.tests.factories import UserFactory
from student import auth
from student.models import CourseEnrollment
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from mobile_api.test_milestones import MobileAPIMilestonesMixin
class MobileAPITestCase(ModuleStoreTestCase, APITestCase):
"""
@@ -124,7 +127,7 @@ class MobileAuthUserTestMixin(MobileAuthTestMixin):
@ddt.ddt
class MobileCourseAccessTestMixin(object):
class MobileCourseAccessTestMixin(MobileAPIMilestonesMixin):
"""
Test Mixin for testing APIs marked with mobile_course_access.
(Use MobileEnrolledCourseAccessTestMixin when verify_enrolled is set to True.)