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
982c9a26
Commit
982c9a26
authored
Oct 28, 2015
by
Tasawer
Committed by
Tasawer Nawaz
Oct 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added photo_id_key while AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING is True
ECOM-2547
parent
d210ca6e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
lms/djangoapps/verify_student/models.py
+3
-0
lms/djangoapps/verify_student/tests/test_models.py
+17
-0
No files found.
lms/djangoapps/verify_student/models.py
View file @
982c9a26
...
...
@@ -647,6 +647,9 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
# verification functionality. If you do want to work on it, you have to
# explicitly enable these in your private settings.
if
settings
.
FEATURES
.
get
(
'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING'
):
# fake photo id key is set only for initial verification
self
.
photo_id_key
=
'fake-photo-id-key'
self
.
save
()
return
aes_key
=
random_aes_key
()
...
...
lms/djangoapps/verify_student/tests/test_models.py
View file @
982c9a26
...
...
@@ -2,6 +2,7 @@
from
datetime
import
timedelta
,
datetime
import
ddt
import
json
import
mock
import
requests.exceptions
import
pytz
...
...
@@ -236,6 +237,22 @@ class TestPhotoVerification(ModuleStoreTestCase):
attempt
=
self
.
create_and_submit
()
assert_equals
(
attempt
.
status
,
"must_retry"
)
@mock.patch.dict
(
settings
.
FEATURES
,
{
'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING'
:
True
})
def
test_submission_while_testing_flag_is_true
(
self
):
""" Test that a fake value is set for field 'photo_id_key' of user's
initial verification when the feature flag 'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING'
is enabled.
"""
user
=
UserFactory
.
create
()
attempt
=
SoftwareSecurePhotoVerification
(
user
=
user
)
user
.
profile
.
name
=
"test-user"
attempt
.
upload_photo_id_image
(
"Image data"
)
attempt
.
mark_ready
()
attempt
.
submit
()
self
.
assertEqual
(
attempt
.
photo_id_key
,
"fake-photo-id-key"
)
def
test_active_for_user
(
self
):
"""
Make sure we can retrive a user's active (in progress) verification
...
...
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