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
400efdf1
Commit
400efdf1
authored
Dec 31, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6421 from edx/will/ecom-850
Set attempting_upgrade session flag in the new payment flow
parents
c183831b
c15adf9c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
lms/djangoapps/verify_student/tests/test_views.py
+6
-0
lms/djangoapps/verify_student/views.py
+4
-0
No files found.
lms/djangoapps/verify_student/tests/test_views.py
View file @
400efdf1
...
...
@@ -993,6 +993,7 @@ class TestPayAndVerifyView(UrlResetMixin, ModuleStoreTestCase):
PayAndVerifyView
.
PHOTO_ID_REQ
,
PayAndVerifyView
.
WEBCAM_REQ
,
])
self
.
_assert_upgrade_session_flag
(
False
)
@ddt.data
(
"expired"
,
"denied"
)
def
test_start_flow_expired_or_denied_verification
(
self
,
verification_status
):
...
...
@@ -1331,6 +1332,7 @@ class TestPayAndVerifyView(UrlResetMixin, ModuleStoreTestCase):
PayAndVerifyView
.
PHOTO_ID_REQ
,
PayAndVerifyView
.
WEBCAM_REQ
,
])
self
.
_assert_upgrade_session_flag
(
True
)
def
test_upgrade_already_verified
(
self
):
course
=
self
.
_create_course
(
"verified"
)
...
...
@@ -1636,6 +1638,10 @@ class TestPayAndVerifyView(UrlResetMixin, ModuleStoreTestCase):
'verification_deadline'
:
pay_and_verify_div
[
'data-verification-deadline'
]
}
def
_assert_upgrade_session_flag
(
self
,
is_upgrade
):
"""Check that the session flag for attempting an upgrade is set. """
self
.
assertEqual
(
self
.
client
.
session
.
get
(
'attempting_upgrade'
),
is_upgrade
)
def
_assert_redirects_to_dashboard
(
self
,
response
):
"""Check that the page redirects to the student dashboard. """
self
.
assertRedirects
(
response
,
reverse
(
'dashboard'
))
...
...
lms/djangoapps/verify_student/views.py
View file @
400efdf1
...
...
@@ -499,6 +499,10 @@ class PayAndVerifyView(View):
'donation_for_course'
,
{}
)
.
get
(
unicode
(
course_key
),
''
)
# Remember whether the user is upgrading
# so we can fire an analytics event upon payment.
request
.
session
[
'attempting_upgrade'
]
=
(
message
==
self
.
UPGRADE_MSG
)
# Render the top-level page
context
=
{
'user_full_name'
:
full_name
,
...
...
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