Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
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
dbfdff09
Commit
dbfdff09
authored
7 years ago
by
Sofiya Semenova
Browse files
Options
Downloads
Patches
Plain Diff
Checking if CAD exists before using it
parent
27a73f77
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/djangoapps/student/tests/test_certificates.py
+11
-3
11 additions, 3 deletions
common/djangoapps/student/tests/test_certificates.py
lms/templates/dashboard/_dashboard_certificate_information.html
+9
-7
9 additions, 7 deletions
...mplates/dashboard/_dashboard_certificate_information.html
with
20 additions
and
10 deletions
common/djangoapps/student/tests/test_certificates.py
+
11
−
3
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
()
...
...
This diff is collapsed.
Click to expand it.
lms/templates/dashboard/_dashboard_certificate_information.html
+
9
−
7
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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