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
62ea4865
Commit
62ea4865
authored
Jan 12, 2015
by
arbisoft
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ECOM-528 updated the test cases
parent
50961fe5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
28 deletions
+9
-28
common/djangoapps/student/tests/test_recent_enrollments.py
+8
-26
common/djangoapps/student/views.py
+1
-2
No files found.
common/djangoapps/student/tests/test_recent_enrollments.py
View file @
62ea4865
...
...
@@ -129,42 +129,24 @@ class TestRecentEnrollments(ModuleStoreTestCase):
@ddt.data
(
#Register as an honor in any course modes with no payment option
([(
'audit'
,
0
),
(
'honor'
,
0
)],
'honor'
,
True
),
([(
'audit'
,
0
)],
'honor'
,
True
),
([(
'honor'
,
0
)],
'honor'
,
True
),
([],
'honor'
,
True
),
#Register as an honor in any course modes which has payment option
([(
'audit'
,
0
),
(
'honor'
,
10
)],
'honor'
,
False
),
([(
'audit'
,
10
),
(
'honor'
,
0
)],
'honor'
,
False
),
([(
'professional'
,
20
)],
'honor'
,
True
),
([(
'verified'
,
20
)],
'honor'
,
True
),
([(
'professional'
,
20
),
(
'verified'
,
20
)],
'honor'
,
True
),
([(
'audit'
,
0
),
(
'honor'
,
5
),
(
'professional'
,
20
)],
'honor'
,
True
),
([(
'audit'
,
0
),
(
'honor'
,
10
),
(
'verified'
,
20
)],
'honor'
,
True
),
([(
'audit'
,
10
),
(
'honor'
,
0
),
(
'verified'
,
20
),
(
'professional'
,
20
)],
'honor'
,
True
),
([(
'audit'
,
10
)],
'honor'
,
False
),
([(
'honor'
,
10
)],
'honor'
,
False
),
([(
'honor'
,
10
)],
'honor'
,
False
),
# This is a paid course
([(
'audit'
,
0
),
(
'honor'
,
0
),
(
'professional'
,
20
)],
'honor'
,
True
),
([(
'audit'
,
0
),
(
'honor'
,
0
),
(
'verified'
,
20
)],
'honor'
,
True
),
([(
'audit'
,
0
),
(
'honor'
,
0
),
(
'verified'
,
20
),
(
'professional'
,
20
)],
'honor'
,
True
),
([],
'honor'
,
True
),
#Register as an audit in any course modes with no payment option
([(
'audit'
,
0
),
(
'honor'
,
0
)],
'audit'
,
True
),
([(
'audit'
,
0
)],
'audit'
,
True
),
([(
'honor'
,
0
)],
'audit'
,
True
),
([],
'audit'
,
True
),
#Register as an audit in any course modes which has payment option
([(
'audit'
,
0
),
(
'honor'
,
10
)],
'audit'
,
False
),
([(
'audit'
,
10
),
(
'honor'
,
0
)],
'audit'
,
False
),
([(
'audit'
,
10
)],
'audit'
,
False
),
([(
'honor'
,
10
)],
'audit'
,
False
),
([],
'audit'
,
True
),
#Register as an audit in any course modes which has no payment option
([(
'audit'
,
0
),
(
'honor'
,
0
),
(
'verified'
,
10
)],
'audit'
,
True
),
#Register as a verified in any course modes which has payment option
([(
'audit'
,
0
),
(
'honor'
,
10
)],
'verified'
,
False
),
([(
'professional'
,
20
)],
'verified'
,
False
),
([(
'professional'
,
20
)],
'professional'
,
False
),
([(
'verified'
,
20
)],
'verified'
,
False
),
([(
'professional'
,
20
),
(
'verified'
,
20
)],
'verified'
,
False
),
([(
'audit'
,
0
),
(
'honor'
,
5
),
(
'professional'
,
20
)],
'verified'
,
False
),
([(
'audit'
,
0
),
(
'honor'
,
10
),
(
'verified'
,
20
)],
'verified'
,
False
),
([(
'audit'
,
0
),
(
'honor'
,
10
),
(
'verified'
,
20
),
(
'professional'
,
20
)],
'verified'
,
False
),
([(
'audit'
,
10
)],
'verified'
,
False
),
([(
'honor'
,
10
)],
'verified'
,
False
),
([(
'audit'
,
0
),
(
'honor'
,
0
),
(
'verified'
,
20
)],
'verified'
,
False
)
)
@ddt.unpack
def
test_donate_button
(
self
,
course_modes
,
enrollment_mode
,
show_donate
):
...
...
common/djangoapps/student/views.py
View file @
62ea4865
...
...
@@ -760,8 +760,7 @@ def _allow_donation(course_modes, course_id, enrollment):
"""
donations_enabled
=
DonationConfiguration
.
current
()
.
enabled
return
donations_enabled
and
enrollment
.
mode
in
course_modes
[
course_id
]
and
\
course_modes
[
course_id
][
enrollment
.
mode
]
.
min_price
==
0
return
donations_enabled
and
enrollment
.
mode
in
course_modes
[
course_id
]
and
course_modes
[
course_id
][
enrollment
.
mode
]
.
min_price
==
0
def
try_change_enrollment
(
request
):
...
...
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