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
13c01ec3
Commit
13c01ec3
authored
Mar 28, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Randomized instructor page tests
parent
bf37d4a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
lms/djangoapps/courseware/tests/tests.py
+17
-13
No files found.
lms/djangoapps/courseware/tests/tests.py
View file @
13c01ec3
...
...
@@ -469,10 +469,13 @@ 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
):
print
'checking for 404 on {0}'
.
format
(
url
)
self
.
check_for_get_code
(
404
,
url
)
# 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
)
# Make the instructor staff in the toy course
group_name
=
_course_staff_group_name
(
self
.
toy
.
location
)
...
...
@@ -483,13 +486,13 @@ 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
):
print
'checking for 200 on {0}'
.
format
(
url
)
self
.
check_for_get_code
(
200
,
url
)
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
):
print
'checking for 404 on {0}'
.
format
(
url
)
self
.
check_for_get_code
(
404
,
url
)
url
=
random
.
choice
(
instructor_urls
(
self
.
full
))
print
'checking for 404 on {0}'
.
format
(
url
)
self
.
check_for_get_code
(
404
,
url
)
# now also make the instructor staff
instructor
=
get_user
(
self
.
instructor
)
...
...
@@ -497,9 +500,10 @@ class TestViewAuth(LoginEnrollmentTestCase):
instructor
.
save
()
# and now should be able to load both
for
url
in
instructor_urls
(
self
.
toy
)
+
instructor_urls
(
self
.
full
):
print
'checking for 200 on {0}'
.
format
(
url
)
self
.
check_for_get_code
(
200
,
url
)
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
)
def
run_wrapped
(
self
,
test
):
"""
...
...
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