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
fe88e60d
Commit
fe88e60d
authored
Oct 06, 2015
by
zubair-arbi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save the self referencing field 'copy_id_photo_from' for ICRV photo verifications + update test
parent
7e55437d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
9 deletions
+24
-9
lms/djangoapps/verify_student/models.py
+11
-3
lms/djangoapps/verify_student/tests/test_models.py
+13
-6
No files found.
lms/djangoapps/verify_student/models.py
View file @
fe88e60d
...
...
@@ -663,10 +663,12 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
@status_before_must_be
(
"must_retry"
,
"ready"
,
"submitted"
)
def
submit
(
self
,
copy_id_photo_from
=
None
):
"""
Submit our verification attempt to Software Secure for validation. This
will set our status to "submitted" if the post is successful, and
"""
Submit our verification attempt to Software Secure for validation.
This
will set our status to "submitted" if the post is successful, and
"must_retry" if the post fails.
This will also set the self referencing field 'copy_id_photo_from' on
the software secure photo validation object.
Keyword Arguments:
copy_id_photo_from (SoftwareSecurePhotoVerification): If provided, re-send the ID photo
...
...
@@ -674,6 +676,12 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
are sent with previously-submitted ID photos.
"""
if
copy_id_photo_from
:
# Update the field 'copy_id_photo_from' with provided software
# secure photo verification object
self
.
copy_id_photo_from
=
copy_id_photo_from
self
.
save
()
try
:
response
=
self
.
send_request
(
copy_id_photo_from
=
copy_id_photo_from
)
if
response
.
ok
:
...
...
lms/djangoapps/verify_student/tests/test_models.py
View file @
fe88e60d
...
...
@@ -484,9 +484,9 @@ class TestPhotoVerification(ModuleStoreTestCase):
self
.
assertIs
(
result
,
None
)
# Make an initial verification with 'photo_id_key'
attempt
=
SoftwareSecurePhotoVerification
(
user
=
user
,
photo_id_key
=
"dummy_photo_id_key"
)
attempt
.
status
=
'approved'
attempt
.
save
()
first_
attempt
=
SoftwareSecurePhotoVerification
(
user
=
user
,
photo_id_key
=
"dummy_photo_id_key"
)
first_
attempt
.
status
=
'approved'
first_
attempt
.
save
()
# Check that method 'get_initial_verification' returns the correct
# initial verification attempt
...
...
@@ -494,9 +494,11 @@ class TestPhotoVerification(ModuleStoreTestCase):
self
.
assertIsNotNone
(
first_result
)
# Now create a second verification without 'photo_id_key'
attempt
=
SoftwareSecurePhotoVerification
(
user
=
user
)
attempt
.
status
=
'submitted'
attempt
.
save
()
second_attempt
=
SoftwareSecurePhotoVerification
(
user
=
user
)
second_attempt
.
mark_ready
()
# Parameter 'copy_id_photo_from' is used for reverification, in which
# new face photos are sent with previously-submitted ID photos
second_attempt
.
submit
(
copy_id_photo_from
=
first_result
)
# Test method 'get_initial_verification' still returns the correct
# initial verification attempt which have 'photo_id_key' set
...
...
@@ -504,6 +506,11 @@ class TestPhotoVerification(ModuleStoreTestCase):
self
.
assertIsNotNone
(
second_result
)
self
.
assertEqual
(
second_result
,
first_result
)
# Also verify that second photo verification has set self referencing field
# 'copy_id_photo_from' with initial verification
self
.
assertIsNotNone
(
second_attempt
.
copy_id_photo_from
)
self
.
assertEqual
(
second_attempt
.
copy_id_photo_from
,
first_attempt
)
@ddt.ddt
class
VerificationCheckpointTest
(
ModuleStoreTestCase
):
...
...
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