merge upstream/master

This commit is contained in:
Rene Sorel
2016-08-25 13:53:43 +02:00
1817 changed files with 60386 additions and 45229 deletions

View File

@@ -11,6 +11,7 @@ Test utilities for mobile API tests:
"""
# pylint: disable=no-member
from datetime import timedelta
from django.conf import settings
from django.utils import timezone
import ddt
@@ -153,6 +154,7 @@ class MobileCourseAccessTestMixin(MobileAPIMilestonesMixin):
"""Base implementation of initializing the user for each test."""
self.login_and_enroll(course_id)
@patch.dict(settings.FEATURES, {'ENABLE_MKTG_SITE': True})
def test_success(self):
self.init_course_access()
@@ -166,7 +168,7 @@ class MobileCourseAccessTestMixin(MobileAPIMilestonesMixin):
response = self.api_response(expected_response_code=None, course_id=non_existent_course_id)
self.verify_failure(response) # allow subclasses to override verification
@patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False})
@patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False, 'ENABLE_MKTG_SITE': True})
def test_unreleased_course(self):
# ensure the course always starts in the future
# pylint: disable=attribute-defined-outside-init
@@ -184,6 +186,7 @@ class MobileCourseAccessTestMixin(MobileAPIMilestonesMixin):
(None, False)
)
@ddt.unpack
@patch.dict(settings.FEATURES, {'ENABLE_MKTG_SITE': True})
def test_non_mobile_available(self, role, should_succeed):
self.init_course_access()
# set mobile_available to False for the test course
@@ -202,6 +205,7 @@ class MobileCourseAccessTestMixin(MobileAPIMilestonesMixin):
(None, False)
)
@ddt.unpack
@patch.dict(settings.FEATURES, {'ENABLE_MKTG_SITE': True})
def test_visible_to_staff_only_course(self, role, should_succeed):
self.init_course_access()
self.course.visible_to_staff_only = True