Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-proctoring
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
OpenEdx
edx-proctoring
Commits
b347ec53
Commit
b347ec53
authored
Jul 13, 2015
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return 404 if the exam code does not exist
parent
aade2803
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletions
+21
-1
edx_proctoring/callbacks.py
+9
-1
edx_proctoring/tests/test_views.py
+12
-0
No files found.
edx_proctoring/callbacks.py
View file @
b347ec53
...
...
@@ -5,6 +5,8 @@ Various callback paths
from
django.template
import
Context
,
loader
from
django.http
import
HttpResponse
from
edx_proctoring.exceptions
import
StudentExamAttemptDoesNotExistsException
from
edx_proctoring.api
import
(
start_exam_attempt_by_code
,
)
...
...
@@ -22,7 +24,13 @@ def start_exam_callback(request, attempt_code): # pylint: disable=unused-argume
"""
# start the exam!
start_exam_attempt_by_code
(
attempt_code
)
try
:
start_exam_attempt_by_code
(
attempt_code
)
except
StudentExamAttemptDoesNotExistsException
:
return
HttpResponse
(
content
=
'That exam code is not valid'
,
status
=
404
)
template
=
loader
.
get_template
(
'proctoring/proctoring_launch_callback.html'
)
...
...
edx_proctoring/tests/test_views.py
View file @
b347ec53
...
...
@@ -755,6 +755,18 @@ class TestStudentProctoredExamAttempt(LoggedInTestCase):
attempt
=
get_exam_attempt_by_id
(
attempt_id
)
self
.
assertIsNotNone
(
attempt
[
'started_at'
])
def
test_bad_exam_code_callback
(
self
):
"""
Assert that we get a 404 when doing a callback on an exam code that does not exist
"""
response
=
self
.
client
.
get
(
reverse
(
'edx_proctoring.anonymous.proctoring_launch_callback.start_exam'
,
args
=
[
'foo'
]
)
)
self
.
assertEqual
(
response
.
status_code
,
404
)
class
TestExamAllowanceView
(
LoggedInTestCase
):
"""
...
...
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