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
1d64b50d
Commit
1d64b50d
authored
Aug 08, 2014
by
Julia Hansbrough
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4743 from edx/flowerhack/fix-upgrade-message
Basic fix for upgrade text bug
parents
5bf38806
3de1ab83
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
lms/djangoapps/verify_student/tests/test_views.py
+15
-2
lms/djangoapps/verify_student/views.py
+3
-3
No files found.
lms/djangoapps/verify_student/tests/test_views.py
View file @
1d64b50d
...
@@ -68,7 +68,8 @@ class TestVerifyView(TestCase):
...
@@ -68,7 +68,8 @@ class TestVerifyView(TestCase):
verified_mode
=
CourseMode
(
course_id
=
self
.
course_key
,
verified_mode
=
CourseMode
(
course_id
=
self
.
course_key
,
mode_slug
=
"verified"
,
mode_slug
=
"verified"
,
mode_display_name
=
"Verified Certificate"
,
mode_display_name
=
"Verified Certificate"
,
min_price
=
50
)
min_price
=
50
,
suggested_prices
=
"50.0,100.0"
)
verified_mode
.
save
()
verified_mode
.
save
()
def
test_invalid_course
(
self
):
def
test_invalid_course
(
self
):
...
@@ -76,9 +77,21 @@ class TestVerifyView(TestCase):
...
@@ -76,9 +77,21 @@ class TestVerifyView(TestCase):
url
=
reverse
(
'verify_student_verify'
,
url
=
reverse
(
'verify_student_verify'
,
kwargs
=
{
"course_id"
:
fake_course_id
})
kwargs
=
{
"course_id"
:
fake_course_id
})
response
=
self
.
client
.
get
(
url
)
response
=
self
.
client
.
get
(
url
)
self
.
assertEquals
(
response
.
status_code
,
302
)
self
.
assertEquals
(
response
.
status_code
,
302
)
def
test_valid_course_registration_text
(
self
):
url
=
reverse
(
'verify_student_verify'
,
kwargs
=
{
"course_id"
:
unicode
(
self
.
course_key
)})
response
=
self
.
client
.
get
(
url
)
self
.
assertIn
(
"You are registering for"
,
response
.
content
)
def
test_valid_course_upgrade_text
(
self
):
url
=
reverse
(
'verify_student_verify'
,
kwargs
=
{
"course_id"
:
unicode
(
self
.
course_key
)})
response
=
self
.
client
.
get
(
url
,
{
'upgrade'
:
"True"
})
self
.
assertIn
(
"You are upgrading your registration for"
,
response
.
content
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MONGO_MODULESTORE
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MONGO_MODULESTORE
)
class
TestVerifiedView
(
TestCase
):
class
TestVerifiedView
(
TestCase
):
...
...
lms/djangoapps/verify_student/views.py
View file @
1d64b50d
...
@@ -102,7 +102,7 @@ class VerifyView(View):
...
@@ -102,7 +102,7 @@ class VerifyView(View):
"currency"
:
verify_mode
.
currency
.
upper
(),
"currency"
:
verify_mode
.
currency
.
upper
(),
"chosen_price"
:
chosen_price
,
"chosen_price"
:
chosen_price
,
"min_price"
:
verify_mode
.
min_price
,
"min_price"
:
verify_mode
.
min_price
,
"upgrade"
:
upgrade
,
"upgrade"
:
upgrade
==
u'True'
,
"can_audit"
:
"audit"
in
modes_dict
,
"can_audit"
:
"audit"
in
modes_dict
,
}
}
...
@@ -149,7 +149,7 @@ class VerifiedView(View):
...
@@ -149,7 +149,7 @@ class VerifiedView(View):
"currency"
:
verify_mode
.
currency
.
upper
(),
"currency"
:
verify_mode
.
currency
.
upper
(),
"chosen_price"
:
chosen_price
,
"chosen_price"
:
chosen_price
,
"create_order_url"
:
reverse
(
"verify_student_create_order"
),
"create_order_url"
:
reverse
(
"verify_student_create_order"
),
"upgrade"
:
upgrade
,
"upgrade"
:
upgrade
==
u'True'
,
"can_audit"
:
"audit"
in
modes_dict
,
"can_audit"
:
"audit"
in
modes_dict
,
}
}
return
render_to_response
(
'verify_student/verified.html'
,
context
)
return
render_to_response
(
'verify_student/verified.html'
,
context
)
...
@@ -302,7 +302,7 @@ def show_requirements(request, course_id):
...
@@ -302,7 +302,7 @@ def show_requirements(request, course_id):
"course_org"
:
course
.
display_org_with_default
,
"course_org"
:
course
.
display_org_with_default
,
"course_num"
:
course
.
display_number_with_default
,
"course_num"
:
course
.
display_number_with_default
,
"is_not_active"
:
not
request
.
user
.
is_active
,
"is_not_active"
:
not
request
.
user
.
is_active
,
"upgrade"
:
upgrade
,
"upgrade"
:
upgrade
==
u'True'
,
}
}
return
render_to_response
(
"verify_student/show_requirements.html"
,
context
)
return
render_to_response
(
"verify_student/show_requirements.html"
,
context
)
...
...
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