Commit bf37d4a9 by Will Daly

Randomized loading of test pages for dark launch test

parent c48f119c
......@@ -578,20 +578,27 @@ class TestViewAuth(LoginEnrollmentTestCase):
def check_non_staff(course):
"""Check that access is right for non-staff in course"""
print '=== Checking non-staff access for {0}'.format(course.id)
for url in instructor_urls(course) + dark_student_urls(course) + reverse_urls(['courseware'], course):
# Randomly sample a dark url
url = random.choice( instructor_urls(course) +
dark_student_urls(course) +
reverse_urls(['courseware'], course))
print 'checking for 404 on {0}'.format(url)
self.check_for_get_code(404, url)
for url in light_student_urls(course):
# Randomly sample a light url
url = random.choice(light_student_urls(course))
print 'checking for 200 on {0}'.format(url)
self.check_for_get_code(200, url)
def check_staff(course):
"""Check that access is right for staff in course"""
print '=== Checking staff access for {0}'.format(course.id)
for url in (instructor_urls(course) +
# Randomly sample a url
url = random.choice(instructor_urls(course) +
dark_student_urls(course) +
light_student_urls(course)):
light_student_urls(course))
print 'checking for 200 on {0}'.format(url)
self.check_for_get_code(200, url)
......
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