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
dbfdff09
Commit
dbfdff09
authored
Oct 06, 2017
by
Sofiya Semenova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checking if CAD exists before using it
parent
27a73f77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
common/djangoapps/student/tests/test_certificates.py
+11
-3
lms/templates/dashboard/_dashboard_certificate_information.html
+9
-7
No files found.
common/djangoapps/student/tests/test_certificates.py
View file @
dbfdff09
...
...
@@ -121,19 +121,27 @@ class CertificateDashboardMessageDisplayTest(CertificateDisplayTestBase):
def
_check_message
(
self
,
certificate_available_date
):
response
=
self
.
client
.
get
(
reverse
(
'dashboard'
))
if
datetime
.
datetime
.
now
(
UTC
)
<
certificate_available_date
:
if
certificate_available_date
is
None
:
self
.
assertNotContains
(
response
,
u"Your certificate will be available on"
)
self
.
assertNotContains
(
response
,
u"View Test_Certificate"
)
elif
datetime
.
datetime
.
now
(
UTC
)
<
certificate_available_date
:
self
.
assertContains
(
response
,
u"Your certificate will be available on"
)
self
.
assertNotContains
(
response
,
u"View Test_Certificate"
)
else
:
self
.
_check_can_download_certificate
()
@ddt.data
(
Fals
e
)
@ddt.data
(
True
,
False
,
Non
e
)
def
test_certificate_available_date
(
self
,
past_certificate_available_date
):
cert
=
self
.
_create_certificate
(
'verified'
)
cert
.
status
=
CertificateStatuses
.
downloadable
cert
.
save
()
certificate_available_date
=
PAST_DATE
if
past_certificate_available_date
else
FUTURE_DATE
if
past_certificate_available_date
is
None
:
certificate_available_date
=
None
elif
past_certificate_available_date
:
certificate_available_date
=
PAST_DATE
elif
not
past_certificate_available_date
:
certificate_available_date
=
FUTURE_DATE
self
.
course
.
certificate_available_date
=
certificate_available_date
self
.
course
.
save
()
...
...
lms/templates/dashboard/_dashboard_certificate_information.html
View file @
dbfdff09
...
...
@@ -31,9 +31,9 @@ else:
%
>
% if cert_status['status'] != 'processing':
<div
class=
"message message-status ${status_css_class} is-shown"
>
% if
not cert_status['certificate_message_viewable']
:
% if (cert_status['status'] == 'generating' or cert_status['status'] == 'downloadable'):
% if not cert_status['certificate_message_viewable']:
% if
(cert_status['status'] == 'generating' or cert_status['status'] == 'downloadable') and course_overview.certificate_available_date
:
<div
class=
"message message-status ${status_css_class} is-shown"
>
<p
class=
"message-copy"
>
<
%
certificate_available_date_string =
course_overview.certificate_available_date.strftime('%Y-%m-%dT%H:%M:%S%z')
...
...
@@ -42,8 +42,10 @@ else:
%
>
<span
class=
"info-date-block localized-datetime"
data-language=
"${user_language}"
data-timezone=
"${user_timezone}"
data-datetime=
"${certificate_available_date_string}"
data-format=
${format}
data-string=
"${container_string}"
></span>
</p>
% endif
% else:
</div>
% endif
% else:
<div
class=
"message message-status ${status_css_class} is-shown"
>
<p
class=
"message-copy"
>
${_("Your final grade:")}
<span
class=
"grade-value"
>
${"{0:.0f}%".format(float(cert_status['grade'])*100)}
</span>
.
...
...
@@ -143,7 +145,7 @@ else:
</div>
% endif
% endif
</div>
</div>
% endif
% endif
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