diff --git a/common/djangoapps/student/management/commands/pearson_export_ead.py b/common/djangoapps/student/management/commands/pearson_export_ead.py index 33ab837d1b..0d7d7d9953 100644 --- a/common/djangoapps/student/management/commands/pearson_export_ead.py +++ b/common/djangoapps/student/management/commands/pearson_export_ead.py @@ -49,7 +49,7 @@ class Command(BaseCommand): ClientAuthorizationID=generate_id(), ClientCandidateID=tcu.client_candidate_id, ExamAuthorizationCount="1", - ExamSeriesCode="MIT 6.002-001", + ExamSeriesCode="6002x001", EligibilityApptDateFirst="2012/12/15", EligibilityApptDateLast="2012/12/30", LastUpdate=datetime.utcnow().strftime("%Y/%m/%d %H:%M:%S") diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 8ce83977b8..8454709681 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -19,7 +19,7 @@ from django.core.context_processors import csrf from django.core.mail import send_mail from django.core.validators import validate_email, validate_slug, ValidationError from django.db import IntegrityError -from django.http import HttpResponse, Http404 +from django.http import HttpResponse, HttpResponseForbidden, Http404 from django.shortcuts import redirect from mitxmako.shortcuts import render_to_response, render_to_string from bs4 import BeautifulSoup @@ -777,7 +777,7 @@ def accept_name_change(request): @csrf_exempt def test_center_login(request): - if not MITX_FEATURES.get('ENABLE_PEARSON_HACK_TEST'): + if not settings.MITX_FEATURES.get('ENABLE_PEARSON_HACK_TEST'): raise Http404 client_candidate_id = request.POST.get("clientCandidateID") @@ -786,10 +786,12 @@ def test_center_login(request): error_url = request.POST.get("errorURL") if client_candidate_id == "edX003671291147": - authenticate(username="pearsontest", password="12345") + user = authenticate(username=settings.PEARSON_TEST_USER, + password=settings.PEARSON_TEST_PASSWORD) + login(request, user) return redirect('/courses/MITx/6.002x/2012_Fall/courseware/Final_Exam/Final_Exam_Fall_2012/') else: - raise Http404 + return HttpResponseForbidden() diff --git a/lms/envs/aws.py b/lms/envs/aws.py index f1ad8bfee1..ae5d2c3e9d 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -79,6 +79,5 @@ XQUEUE_INTERFACE = AUTH_TOKENS['XQUEUE_INTERFACE'] if 'COURSE_ID' in ENV_TOKENS: ASKBOT_URL = "courses/{0}/discussions/".format(ENV_TOKENS['COURSE_ID']) - -# Temporary hack for testing Pearson -MITX_FEATURES['ENABLE_PEARSON_HACK_TEST'] = True \ No newline at end of file +PEARSON_TEST_USER = "pearsontest" +PEARSON_TEST_PASSWORD = AUTH_TOKENS["PEARSON_TEST_PASSWORD"] \ No newline at end of file diff --git a/lms/envs/dev.py b/lms/envs/dev.py index 9114f099d4..f5213ba593 100644 --- a/lms/envs/dev.py +++ b/lms/envs/dev.py @@ -173,3 +173,8 @@ FILE_UPLOAD_HANDLERS = ( ########################### PIPELINE ################################# PIPELINE_SASS_ARGUMENTS = '-r {proj_dir}/static/sass/bourbon/lib/bourbon.rb'.format(proj_dir=PROJECT_ROOT) + +########################## PEARSON TESTING ########################### +MITX_FEATURES['ENABLE_PEARSON_HACK_TEST'] = True +PEARSON_TEST_USER = "pearsontest" +PEARSON_TEST_PASSWORD = "12345"