Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
e62df6fa
Commit
e62df6fa
authored
3 years ago
by
Justin Hynes
Browse files
Options
Downloads
Patches
Plain Diff
refactor!: Remove unused `is_certificate_valid` function
[MICROBA-1354] * Remove unused `is_certificate_valid` function
parent
8aedebcd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openedx/core/djangoapps/certificates/api.py
+0
-7
0 additions, 7 deletions
openedx/core/djangoapps/certificates/api.py
openedx/core/djangoapps/certificates/tests/test_api.py
+0
-31
0 additions, 31 deletions
openedx/core/djangoapps/certificates/tests/test_api.py
with
0 additions
and
38 deletions
openedx/core/djangoapps/certificates/api.py
+
0
−
7
View file @
e62df6fa
...
...
@@ -30,13 +30,6 @@ def _enabled_and_instructor_paced(course):
return
False
def
is_certificate_valid
(
certificate
):
"""
Returns True if the student has a valid, verified certificate for this course, False otherwise.
"""
return
CourseEnrollment
.
is_enrolled_as_verified
(
certificate
.
user
,
certificate
.
course_id
)
and
certificate
.
is_valid
()
def
can_show_certificate_message
(
course
,
student
,
course_grade
,
certificates_enabled_for_course
):
"""
Returns True if a course certificate message can be shown
...
...
This diff is collapsed.
Click to expand it.
openedx/core/djangoapps/certificates/tests/test_api.py
+
0
−
31
View file @
e62df6fa
...
...
@@ -10,7 +10,6 @@ from django.test import TestCase
from
edx_toggles.toggles
import
LegacyWaffleSwitch
from
edx_toggles.toggles.testutils
import
override_waffle_switch
from
common.djangoapps.course_modes.models
import
CourseMode
from
common.djangoapps.student.tests.factories
import
CourseEnrollmentFactory
,
UserFactory
from
openedx.core.djangoapps.certificates
import
api
from
openedx.core.djangoapps.certificates.config
import
waffle
as
certs_waffle
...
...
@@ -119,36 +118,6 @@ class CertificatesApiTestCase(TestCase):
with
configure_waffle_namespace
(
feature_enabled
):
assert
expected_value
==
api
.
can_show_certificate_available_date_field
(
self
.
course
)
@ddt.data
(
(
CourseMode
.
VERIFIED
,
CertificateStatuses
.
downloadable
,
True
),
(
CourseMode
.
VERIFIED
,
CertificateStatuses
.
notpassing
,
False
),
(
CourseMode
.
AUDIT
,
CertificateStatuses
.
downloadable
,
False
)
)
@ddt.unpack
def
test_is_certificate_valid
(
self
,
enrollment_mode
,
certificate_status
,
expected_value
):
self
.
enrollment
.
mode
=
enrollment_mode
self
.
enrollment
.
save
()
self
.
certificate
.
mode
=
CourseMode
.
VERIFIED
self
.
certificate
.
status
=
certificate_status
assert
expected_value
==
api
.
is_certificate_valid
(
self
.
certificate
)
@ddt.data
(
(
CourseMode
.
VERIFIED
,
CertificateStatuses
.
downloadable
,
True
),
(
CourseMode
.
VERIFIED
,
CertificateStatuses
.
notpassing
,
False
),
(
CourseMode
.
AUDIT
,
CertificateStatuses
.
downloadable
,
False
)
)
@ddt.unpack
def
test_available_date
(
self
,
enrollment_mode
,
certificate_status
,
expected_value
):
self
.
enrollment
.
mode
=
enrollment_mode
self
.
enrollment
.
save
()
self
.
certificate
.
mode
=
CourseMode
.
VERIFIED
self
.
certificate
.
status
=
certificate_status
assert
expected_value
==
api
.
is_certificate_valid
(
self
.
certificate
)
@ddt.data
(
(
True
,
True
,
False
),
# feature enabled and self-paced should return False
(
True
,
False
,
True
),
# feature enabled and instructor-paced should return True
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment