Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
bf37d4a9
Commit
bf37d4a9
authored
Mar 28, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Randomized loading of test pages for dark launch test
parent
c48f119c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
lms/djangoapps/courseware/tests/tests.py
+11
-4
No files found.
lms/djangoapps/courseware/tests/tests.py
View file @
bf37d4a9
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment