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
067ca021
Commit
067ca021
authored
Oct 21, 2016
by
Noraiz
Committed by
Noraiz Anwar
Oct 28, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logging improved for case exception raised during submission to SoftwareSecure.
parent
c604cada
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
lms/djangoapps/verify_student/models.py
+5
-2
lms/djangoapps/verify_student/tests/test_models.py
+10
-3
No files found.
lms/djangoapps/verify_student/models.py
View file @
067ca021
...
...
@@ -721,8 +721,11 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
self
.
status
=
"must_retry"
self
.
error_msg
=
response
.
text
self
.
save
()
except
Exception
as
error
:
log
.
exception
(
error
)
except
Exception
:
# pylint: disable=broad-except
log
.
exception
(
'Software Secure submission failed for user
%
s, setting status to must_retry'
,
self
.
user
.
username
)
self
.
status
=
"must_retry"
self
.
save
()
...
...
lms/djangoapps/verify_student/tests/test_models.py
View file @
067ca021
...
...
@@ -12,6 +12,7 @@ from mock import patch
from
nose.tools
import
assert_is_none
,
assert_equals
,
assert_raises
,
assert_true
,
assert_false
# pylint: disable=no-name-in-module
import
pytz
import
requests.exceptions
from
testfixtures
import
LogCapture
from
common.test.utils
import
MockS3Mixin
from
student.tests.factories
import
UserFactory
...
...
@@ -28,6 +29,7 @@ from lms.djangoapps.verify_student.models import (
VerificationDeadline
)
FAKE_SETTINGS
=
{
"SOFTWARE_SECURE"
:
{
"FACE_IMAGE_AES_KEY"
:
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
,
...
...
@@ -204,10 +206,15 @@ class TestPhotoVerification(MockS3Mixin, ModuleStoreTestCase):
attempt
=
self
.
create_and_submit
()
assert_equals
(
attempt
.
status
,
"must_retry"
)
# We try to post, but run into an error (in this case a ne
wt
ork connection error)
# We try to post, but run into an error (in this case a ne
tw
ork connection error)
with
patch
(
'lms.djangoapps.verify_student.models.requests.post'
,
new
=
mock_software_secure_post_unavailable
):
attempt
=
self
.
create_and_submit
()
assert_equals
(
attempt
.
status
,
"must_retry"
)
with
LogCapture
(
'lms.djangoapps.verify_student.models'
)
as
logger
:
attempt
=
self
.
create_and_submit
()
assert_equals
(
attempt
.
status
,
"must_retry"
)
logger
.
check
(
(
'lms.djangoapps.verify_student.models'
,
'ERROR'
,
'Software Secure submission failed for user
%
s, setting status to must_retry'
%
attempt
.
user
.
username
))
@mock.patch.dict
(
settings
.
FEATURES
,
{
'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING'
:
True
})
def
test_submission_while_testing_flag_is_true
(
self
):
...
...
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