Commit 897fddba by Will Daly

Merge pull request #8804 from edx/merge-release-into-master

Merge release into master
parents e9756a9b 104bcd51
...@@ -4,6 +4,7 @@ Tests for credit courses on the student dashboard. ...@@ -4,6 +4,7 @@ Tests for credit courses on the student dashboard.
import unittest import unittest
import datetime import datetime
from mock import patch
import pytz import pytz
from django.conf import settings from django.conf import settings
...@@ -26,6 +27,7 @@ TEST_CREDIT_PROVIDER_SECRET_KEY = "931433d583c84ca7ba41784bad3232e6" ...@@ -26,6 +27,7 @@ TEST_CREDIT_PROVIDER_SECRET_KEY = "931433d583c84ca7ba41784bad3232e6"
@override_settings(CREDIT_PROVIDER_SECRET_KEYS={ @override_settings(CREDIT_PROVIDER_SECRET_KEYS={
"hogwarts": TEST_CREDIT_PROVIDER_SECRET_KEY, "hogwarts": TEST_CREDIT_PROVIDER_SECRET_KEY,
}) })
@patch.dict(settings.FEATURES, {"ENABLE_CREDIT_ELIGIBILITY": True})
class CreditCourseDashboardTest(ModuleStoreTestCase): class CreditCourseDashboardTest(ModuleStoreTestCase):
""" """
Tests for credit courses on the student dashboard. Tests for credit courses on the student dashboard.
......
...@@ -803,6 +803,10 @@ def _credit_statuses(user, course_enrollment_pairs): ...@@ -803,6 +803,10 @@ def _credit_statuses(user, course_enrollment_pairs):
""" """
from openedx.core.djangoapps.credit import api as credit_api from openedx.core.djangoapps.credit import api as credit_api
# Feature flag off
if not settings.FEATURES.get("ENABLE_CREDIT_ELIGIBILITY"):
return {}
request_status_by_course = { request_status_by_course = {
request["course_key"]: request["status"] request["course_key"]: request["status"]
for request in credit_api.get_credit_requests_for_user(user.username) for request in credit_api.get_credit_requests_for_user(user.username)
......
...@@ -4,6 +4,7 @@ Tests for the API functions in the credit app. ...@@ -4,6 +4,7 @@ Tests for the API functions in the credit app.
import datetime import datetime
import ddt import ddt
import pytz import pytz
from django.test import TestCase from django.test import TestCase
from django.test.utils import override_settings from django.test.utils import override_settings
from django.db import connection, transaction from django.db import connection, transaction
......
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