Commit 4b02b2af by David Ormsbee

Rearrange how we handle the auth tokens for our fake Pearson preliminary testing

parent 528fcd7f
...@@ -49,7 +49,7 @@ class Command(BaseCommand): ...@@ -49,7 +49,7 @@ class Command(BaseCommand):
ClientAuthorizationID=generate_id(), ClientAuthorizationID=generate_id(),
ClientCandidateID=tcu.client_candidate_id, ClientCandidateID=tcu.client_candidate_id,
ExamAuthorizationCount="1", ExamAuthorizationCount="1",
ExamSeriesCode="MIT 6.002-001", ExamSeriesCode="6002x001",
EligibilityApptDateFirst="2012/12/15", EligibilityApptDateFirst="2012/12/15",
EligibilityApptDateLast="2012/12/30", EligibilityApptDateLast="2012/12/30",
LastUpdate=datetime.utcnow().strftime("%Y/%m/%d %H:%M:%S") LastUpdate=datetime.utcnow().strftime("%Y/%m/%d %H:%M:%S")
......
...@@ -19,7 +19,7 @@ from django.core.context_processors import csrf ...@@ -19,7 +19,7 @@ from django.core.context_processors import csrf
from django.core.mail import send_mail from django.core.mail import send_mail
from django.core.validators import validate_email, validate_slug, ValidationError from django.core.validators import validate_email, validate_slug, ValidationError
from django.db import IntegrityError from django.db import IntegrityError
from django.http import HttpResponse, Http404 from django.http import HttpResponse, HttpResponseForbidden, Http404
from django.shortcuts import redirect from django.shortcuts import redirect
from mitxmako.shortcuts import render_to_response, render_to_string from mitxmako.shortcuts import render_to_response, render_to_string
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
...@@ -777,7 +777,7 @@ def accept_name_change(request): ...@@ -777,7 +777,7 @@ def accept_name_change(request):
@csrf_exempt @csrf_exempt
def test_center_login(request): 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 raise Http404
client_candidate_id = request.POST.get("clientCandidateID") client_candidate_id = request.POST.get("clientCandidateID")
...@@ -786,10 +786,12 @@ def test_center_login(request): ...@@ -786,10 +786,12 @@ def test_center_login(request):
error_url = request.POST.get("errorURL") error_url = request.POST.get("errorURL")
if client_candidate_id == "edX003671291147": 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/') return redirect('/courses/MITx/6.002x/2012_Fall/courseware/Final_Exam/Final_Exam_Fall_2012/')
else: else:
raise Http404 return HttpResponseForbidden()
...@@ -79,6 +79,5 @@ XQUEUE_INTERFACE = AUTH_TOKENS['XQUEUE_INTERFACE'] ...@@ -79,6 +79,5 @@ XQUEUE_INTERFACE = AUTH_TOKENS['XQUEUE_INTERFACE']
if 'COURSE_ID' in ENV_TOKENS: if 'COURSE_ID' in ENV_TOKENS:
ASKBOT_URL = "courses/{0}/discussions/".format(ENV_TOKENS['COURSE_ID']) ASKBOT_URL = "courses/{0}/discussions/".format(ENV_TOKENS['COURSE_ID'])
PEARSON_TEST_USER = "pearsontest"
# Temporary hack for testing Pearson PEARSON_TEST_PASSWORD = AUTH_TOKENS["PEARSON_TEST_PASSWORD"]
MITX_FEATURES['ENABLE_PEARSON_HACK_TEST'] = True \ No newline at end of file
\ No newline at end of file
...@@ -173,3 +173,8 @@ FILE_UPLOAD_HANDLERS = ( ...@@ -173,3 +173,8 @@ FILE_UPLOAD_HANDLERS = (
########################### PIPELINE ################################# ########################### PIPELINE #################################
PIPELINE_SASS_ARGUMENTS = '-r {proj_dir}/static/sass/bourbon/lib/bourbon.rb'.format(proj_dir=PROJECT_ROOT) 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"
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