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
f2f44312
Commit
f2f44312
authored
May 21, 2015
by
Awais
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ECOM-1600 fixing certs button issue.
parent
a4dd6e56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
lms/djangoapps/courseware/tests/test_views.py
+10
-1
lms/djangoapps/courseware/views.py
+1
-1
No files found.
lms/djangoapps/courseware/tests/test_views.py
View file @
f2f44312
...
...
@@ -846,6 +846,8 @@ class IsCoursePassedTests(ModuleStoreTestCase):
Tests for the is_course_passed helper function
"""
SUCCESS_CUTOFF
=
0.5
def
setUp
(
self
):
super
(
IsCoursePassedTests
,
self
)
.
setUp
()
...
...
@@ -854,7 +856,7 @@ class IsCoursePassedTests(ModuleStoreTestCase):
org
=
'edx'
,
number
=
'verified'
,
display_name
=
'Verified Course'
,
grade_cutoffs
=
{
'cutoff'
:
0.75
,
'Pass'
:
0.5
}
grade_cutoffs
=
{
'cutoff'
:
0.75
,
'Pass'
:
self
.
SUCCESS_CUTOFF
}
)
self
.
request
=
RequestFactory
()
...
...
@@ -874,6 +876,13 @@ class IsCoursePassedTests(ModuleStoreTestCase):
# If user has below passing marks then False will return
self
.
assertFalse
(
views
.
is_course_passed
(
self
.
course
,
None
,
self
.
student
,
self
.
request
))
@patch
(
'courseware.grades.grade'
,
Mock
(
return_value
=
{
'percent'
:
SUCCESS_CUTOFF
}))
def
test_user_with_passing_marks_and_achieved_marks_equal
(
self
):
# Mocking the grades.grade
# If user's achieved passing marks are equal to the required passing
# marks then it will return True
self
.
assertTrue
(
views
.
is_course_passed
(
self
.
course
,
None
,
self
.
student
,
self
.
request
))
@attr
(
'shard_1'
)
class
GenerateUserCertTests
(
ModuleStoreTestCase
):
...
...
lms/djangoapps/courseware/views.py
View file @
f2f44312
...
...
@@ -1302,7 +1302,7 @@ def is_course_passed(course, grade_summary=None, student=None, request=None):
if
grade_summary
is
None
:
grade_summary
=
grades
.
grade
(
student
,
request
,
course
)
return
success_cutoff
and
grade_summary
[
'percent'
]
>
success_cutoff
return
success_cutoff
and
grade_summary
[
'percent'
]
>
=
success_cutoff
@require_POST
...
...
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