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
761db165
Commit
761db165
authored
Jun 01, 2017
by
ayub-khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LEARNER-925 - Allow user to get program certificate if enrolled as verified in credit course
parent
3b39aa49
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletions
+23
-1
openedx/core/djangoapps/programs/tests/test_utils.py
+17
-0
openedx/core/djangoapps/programs/utils.py
+6
-1
No files found.
openedx/core/djangoapps/programs/tests/test_utils.py
View file @
761db165
...
...
@@ -518,6 +518,23 @@ class TestProgramProgressMeter(TestCase):
meter
=
ProgramProgressMeter
(
self
.
user
)
self
.
assertEqual
(
meter
.
completed_programs
,
[
program
[
'uuid'
]])
@mock.patch
(
UTILS_MODULE
+
'.ProgramProgressMeter.completed_course_runs'
,
new_callable
=
mock
.
PropertyMock
)
def
test_credit_course_counted_complete_for_verified
(
self
,
mock_completed_course_runs
,
mock_get_programs
):
"""
Verify that 'credit' course certificate type are treated as if they were
"verified" when checking for course completion status.
"""
course_run_key
=
generate_course_run_key
()
course
=
CourseFactory
(
course_runs
=
[
CourseRunFactory
(
key
=
course_run_key
,
type
=
'credit'
),
])
program
=
ProgramFactory
(
courses
=
[
course
])
mock_get_programs
.
return_value
=
[
program
]
self
.
_create_enrollments
(
course_run_key
)
meter
=
ProgramProgressMeter
(
self
.
user
)
mock_completed_course_runs
.
return_value
=
[{
'course_run_id'
:
course_run_key
,
'type'
:
'verified'
}]
self
.
assertEqual
(
meter
.
_is_course_complete
(
course
),
True
)
@ddt.ddt
@override_settings
(
ECOMMERCE_PUBLIC_URL_ROOT
=
ECOMMERCE_URL_ROOT
)
...
...
openedx/core/djangoapps/programs/utils.py
View file @
761db165
...
...
@@ -266,7 +266,12 @@ class ProgramProgressMeter(object):
# count towards completion of a course in a program). This may change
# in the future to make use of the more rigid set of "applicable seat
# types" associated with each program type in the catalog.
'type'
:
course_run
[
'type'
],
# Runs of type 'credit' are counted as 'verified' since verified
# certificates are earned when credit runs are completed. LEARNER-1274
# tracks a cleaner way to do this using the discovery service's
# applicable_seat_types field.
'type'
:
'verified'
if
course_run
[
'type'
]
==
'credit'
else
course_run
[
'type'
],
}
return
any
(
reshape
(
course_run
)
in
self
.
completed_course_runs
for
course_run
in
course
[
'course_runs'
])
...
...
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