Commit 1115a3b4 by Victor Shnayder

make test course loading deterministic by using course_id

parent c5562e70
<course filename="6.002_Spring_2012" slug="6.002_Spring_2012" graceperiod="1 day 12 hours 59 minutes 59 seconds" showanswer="attempted" rerandomize="never" name="6.002 Spring 2012" start="2015-07-17T12:00" course="full" org="edx"/>
<course filename="6.002_Spring_2012" slug="6.002_Spring_2012" graceperiod="1 day 12 hours 59 minutes 59 seconds" showanswer="attempted" rerandomize="never" name="6.002 Spring 2012" start="2015-07-17T12:00" course="full" org="edX"/>
......@@ -294,12 +294,12 @@ class TestNavigation(PageLoader):
xmodule.modulestore.django._MODULESTORES = {}
courses = modulestore().get_courses()
def find_course(name):
def find_course(course_id):
"""Assumes the course is present"""
return [c for c in courses if c.location.course==name][0]
return [c for c in courses if c.id==course_id][0]
self.full = find_course("full")
self.toy = find_course("toy")
self.full = find_course("edX/full/6.002_Spring_2012")
self.toy = find_course("edX/toy/2012_Fall")
# Create two accounts
self.student = 'view@test.com'
......@@ -352,12 +352,12 @@ class TestViewAuth(PageLoader):
xmodule.modulestore.django._MODULESTORES = {}
courses = modulestore().get_courses()
def find_course(name):
def find_course(course_id):
"""Assumes the course is present"""
return [c for c in courses if c.location.course==name][0]
return [c for c in courses if c.id==course_id][0]
self.full = find_course("full")
self.toy = find_course("toy")
self.full = find_course("edX/full/6.002_Spring_2012")
self.toy = find_course("edX/toy/2012_Fall")
# Create two accounts
self.student = 'view@test.com'
......
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