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
3fcd7c69
Commit
3fcd7c69
authored
Oct 06, 2017
by
Sofiya Semenova
Committed by
GitHub
Oct 06, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16183 from edx/ssemenova/ed-1315-part3
Checking if CAD exists before using it in dashboard
parents
f44f3045
dbfdff09
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 @
3fcd7c69
...
@@ -121,19 +121,27 @@ class CertificateDashboardMessageDisplayTest(CertificateDisplayTestBase):
...
@@ -121,19 +121,27 @@ class CertificateDashboardMessageDisplayTest(CertificateDisplayTestBase):
def
_check_message
(
self
,
certificate_available_date
):
def
_check_message
(
self
,
certificate_available_date
):
response
=
self
.
client
.
get
(
reverse
(
'dashboard'
))
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
.
assertContains
(
response
,
u"Your certificate will be available on"
)
self
.
assertNotContains
(
response
,
u"View Test_Certificate"
)
self
.
assertNotContains
(
response
,
u"View Test_Certificate"
)
else
:
else
:
self
.
_check_can_download_certificate
()
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
):
def
test_certificate_available_date
(
self
,
past_certificate_available_date
):
cert
=
self
.
_create_certificate
(
'verified'
)
cert
=
self
.
_create_certificate
(
'verified'
)
cert
.
status
=
CertificateStatuses
.
downloadable
cert
.
status
=
CertificateStatuses
.
downloadable
cert
.
save
()
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
.
certificate_available_date
=
certificate_available_date
self
.
course
.
save
()
self
.
course
.
save
()
...
...
lms/templates/dashboard/_dashboard_certificate_information.html
View file @
3fcd7c69
...
@@ -31,9 +31,9 @@ else:
...
@@ -31,9 +31,9 @@ else:
%
>
%
>
% if cert_status['status'] != 'processing':
% if cert_status['status'] != 'processing':
<div
class=
"message message-status ${status_css_class} is-shown"
>
% if not cert_status['certificate_message_viewable']:
% if
not cert_status['certificate_message_viewable']
:
% if
(cert_status['status'] == 'generating' or cert_status['status'] == 'downloadable') and course_overview.certificate_available_date
:
% if (cert_status['status'] == 'generating' or cert_status['status'] == 'downloadable'):
<div
class=
"message message-status ${status_css_class} is-shown"
>
<p
class=
"message-copy"
>
<p
class=
"message-copy"
>
<
%
<
%
certificate_available_date_string =
course_overview.certificate_available_date.strftime('%Y-%m-%dT%H:%M:%S%z')
certificate_available_date_string =
course_overview.certificate_available_date.strftime('%Y-%m-%dT%H:%M:%S%z')
...
@@ -42,8 +42,10 @@ else:
...
@@ -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>
<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>
</p>
% endif
</div>
% else:
% endif
% else:
<div
class=
"message message-status ${status_css_class} is-shown"
>
<p
class=
"message-copy"
>
${_("Your final grade:")}
<p
class=
"message-copy"
>
${_("Your final grade:")}
<span
class=
"grade-value"
>
${"{0:.0f}%".format(float(cert_status['grade'])*100)}
</span>
.
<span
class=
"grade-value"
>
${"{0:.0f}%".format(float(cert_status['grade'])*100)}
</span>
.
...
@@ -143,7 +145,7 @@ else:
...
@@ -143,7 +145,7 @@ else:
</div>
</div>
% endif
% endif
% endif
</div>
</div>
% endif
% 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