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
13ee19bd
Commit
13ee19bd
authored
Jan 13, 2016
by
Peter Fogg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow certificates with 'auditing' status to be regenerated.
ECOM-3401
parent
fdeceb10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
1 deletions
+42
-1
lms/djangoapps/certificates/queue.py
+2
-1
lms/djangoapps/certificates/tests/test_queue.py
+40
-0
No files found.
lms/djangoapps/certificates/queue.py
View file @
13ee19bd
...
...
@@ -220,7 +220,8 @@ class XQueueCertInterface(object):
status
.
deleted
,
status
.
error
,
status
.
notpassing
,
status
.
downloadable
status
.
downloadable
,
status
.
auditing
,
]
cert_status
=
certificate_status_for_student
(
student
,
course_id
)[
'status'
]
...
...
lms/djangoapps/certificates/tests/test_queue.py
View file @
13ee19bd
...
...
@@ -122,6 +122,46 @@ class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase):
body
=
json
.
loads
(
kwargs
[
'body'
])
self
.
assertIn
(
expected_template_name
,
body
[
'template_pdf'
])
def
assert_ineligible_certificate_generated
(
self
,
mock_send
,
expected_mode
):
"""
Assert that an ineligible certificate was generated with the
correct mode.
"""
# Ensure the certificate was not generated
self
.
assertFalse
(
mock_send
.
called
)
certificate
=
GeneratedCertificate
.
objects
.
get
(
# pylint: disable=no-member
user
=
self
.
user_2
,
course_id
=
self
.
course
.
id
)
self
.
assertFalse
(
certificate
.
eligible_for_certificate
)
self
.
assertEqual
(
certificate
.
mode
,
expected_mode
)
@ddt.data
(
(
CertificateStatuses
.
restricted
,
False
),
(
CertificateStatuses
.
deleting
,
False
),
(
CertificateStatuses
.
generating
,
True
),
(
CertificateStatuses
.
unavailable
,
True
),
(
CertificateStatuses
.
deleted
,
True
),
(
CertificateStatuses
.
error
,
True
),
(
CertificateStatuses
.
notpassing
,
True
),
(
CertificateStatuses
.
downloadable
,
True
),
(
CertificateStatuses
.
auditing
,
True
),
)
@ddt.unpack
def
test_add_cert_statuses
(
self
,
status
,
should_generate
):
"""
Test that certificates can or cannot be generated with the given
certificate status.
"""
with
patch
(
'certificates.queue.certificate_status_for_student'
,
Mock
(
return_value
=
{
'status'
:
status
})):
mock_send
=
self
.
add_cert_to_queue
(
'verified'
)
if
should_generate
:
self
.
assertTrue
(
mock_send
.
called
)
else
:
self
.
assertFalse
(
mock_send
.
called
)
@attr
(
'shard_1'
)
@override_settings
(
CERT_QUEUE
=
'certificates'
)
...
...
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