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
480cf570
Commit
480cf570
authored
May 05, 2017
by
Andy Armstrong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve test failure message
parent
37eba6ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
lms/djangoapps/certificates/models.py
+6
-0
lms/djangoapps/certificates/tests/test_api.py
+1
-0
lms/djangoapps/certificates/tests/test_webview_views.py
+2
-2
No files found.
lms/djangoapps/certificates/models.py
View file @
480cf570
...
...
@@ -302,6 +302,12 @@ class GeneratedCertificate(models.Model):
else
:
return
query
.
values
(
'status'
)
.
annotate
(
count
=
Count
(
'status'
))
def
__repr__
(
self
):
return
"<GeneratedCertificate: {course_id}, user={user}>"
.
format
(
course_id
=
self
.
course_id
,
user
=
self
.
user
)
def
invalidate
(
self
):
"""
Invalidate Generated Certificate by marking it 'unavailable'.
...
...
lms/djangoapps/certificates/tests/test_api.py
View file @
480cf570
...
...
@@ -369,6 +369,7 @@ class CertificateGetTests(SharedModuleStoreTestCase):
@classmethod
def
tearDownClass
(
cls
):
super
(
CertificateGetTests
,
cls
)
.
tearDownClass
()
cls
.
freezer
.
stop
()
def
test_get_certificate_for_user
(
self
):
...
...
lms/djangoapps/certificates/tests/test_webview_views.py
View file @
480cf570
...
...
@@ -721,7 +721,7 @@ class CertificatesViewsTests(CommonCertificatesTestCase):
course_id
=
unicode
(
self
.
course
.
id
)
)
self
.
cert
.
delete
()
self
.
assert
Equal
(
len
(
GeneratedCertificate
.
eligible_certificates
.
all
()),
0
)
self
.
assert
ListEqual
(
list
(
GeneratedCertificate
.
eligible_certificates
.
all
()),
[]
)
response
=
self
.
client
.
get
(
test_url
)
self
.
assertIn
(
'invalid'
,
response
.
content
)
...
...
@@ -744,7 +744,7 @@ class CertificatesViewsTests(CommonCertificatesTestCase):
preview mode. Either the certificate is marked active or not.
"""
self
.
cert
.
delete
()
self
.
assert
Equal
(
len
(
GeneratedCertificate
.
eligible_certificates
.
all
()),
0
)
self
.
assert
ListEqual
(
list
(
GeneratedCertificate
.
eligible_certificates
.
all
()),
[]
)
self
.
_add_course_certificates
(
count
=
1
,
signatory_count
=
2
)
test_url
=
get_certificate_url
(
user_id
=
self
.
user
.
id
,
...
...
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