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

This commit is contained in:
David Ormsbee
2012-11-07 17:20:49 -05:00
parent 528fcd7f4e
commit 4b02b2af2a
4 changed files with 14 additions and 8 deletions

View File

@@ -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")

View File

@@ -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()

View File

@@ -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
PEARSON_TEST_USER = "pearsontest"
PEARSON_TEST_PASSWORD = AUTH_TOKENS["PEARSON_TEST_PASSWORD"]

View File

@@ -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"