Commit 13c01ec3 by Will Daly

Randomized instructor page tests

parent bf37d4a9
......@@ -469,8 +469,11 @@ class TestViewAuth(LoginEnrollmentTestCase):
'student_id': get_user(self.student).id}))
return urls
# shouldn't be able to get to the instructor pages
for url in instructor_urls(self.toy) + instructor_urls(self.full):
# Randomly sample an instructor page
url = random.choice(instructor_urls(self.toy) +
instructor_urls(self.full))
# Shouldn't be able to get to the instructor pages
print 'checking for 404 on {0}'.format(url)
self.check_for_get_code(404, url)
......@@ -483,11 +486,11 @@ class TestViewAuth(LoginEnrollmentTestCase):
self.login(self.instructor, self.password)
# Now should be able to get to the toy course, but not the full course
for url in instructor_urls(self.toy):
url = random.choice(instructor_urls(self.toy))
print 'checking for 200 on {0}'.format(url)
self.check_for_get_code(200, url)
for url in instructor_urls(self.full):
url = random.choice(instructor_urls(self.full))
print 'checking for 404 on {0}'.format(url)
self.check_for_get_code(404, url)
......@@ -497,7 +500,8 @@ class TestViewAuth(LoginEnrollmentTestCase):
instructor.save()
# and now should be able to load both
for url in instructor_urls(self.toy) + instructor_urls(self.full):
url = random.choice(instructor_urls(self.toy) +
instructor_urls(self.full))
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