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
aa529fe0
Commit
aa529fe0
authored
Nov 25, 2015
by
Zia Fazal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove audit course mode
removed print statement
parent
5043b465
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
11 deletions
+20
-11
cms/djangoapps/contentstore/views/certificates.py
+5
-3
cms/djangoapps/contentstore/views/tests/test_certificates.py
+14
-0
cms/static/js/certificates/spec/views/certificate_preview_spec.js
+1
-6
cms/static/js/certificates/views/certificate_preview.js
+0
-2
No files found.
cms/djangoapps/contentstore/views/certificates.py
View file @
aa529fe0
...
@@ -354,9 +354,11 @@ def certificates_list_handler(request, course_key_string):
...
@@ -354,9 +354,11 @@ def certificates_list_handler(request, course_key_string):
handler_name
=
'certificates.certificate_activation_handler'
,
handler_name
=
'certificates.certificate_activation_handler'
,
course_key
=
course_key
course_key
=
course_key
)
)
course_modes
=
[
mode
.
slug
for
mode
in
CourseMode
.
modes_for_course
(
course_modes
=
[
course_id
=
course
.
id
,
include_expired
=
True
mode
.
slug
for
mode
in
CourseMode
.
modes_for_course
(
)]
course_id
=
course
.
id
,
include_expired
=
True
)
if
mode
.
slug
!=
'audit'
]
certificate_web_view_url
=
get_lms_link_for_certificate_web_view
(
certificate_web_view_url
=
get_lms_link_for_certificate_web_view
(
user_id
=
request
.
user
.
id
,
user_id
=
request
.
user
.
id
,
course_key
=
course_key
,
course_key
=
course_key
,
...
...
cms/djangoapps/contentstore/views/tests/test_certificates.py
View file @
aa529fe0
...
@@ -22,6 +22,7 @@ from xmodule.exceptions import NotFoundError
...
@@ -22,6 +22,7 @@ from xmodule.exceptions import NotFoundError
from
student.models
import
CourseEnrollment
from
student.models
import
CourseEnrollment
from
student.roles
import
CourseInstructorRole
,
CourseStaffRole
from
student.roles
import
CourseInstructorRole
,
CourseStaffRole
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
from
course_modes.tests.factories
import
CourseModeFactory
from
contentstore.views.certificates
import
CertificateManager
from
contentstore.views.certificates
import
CertificateManager
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
from
contentstore.utils
import
get_lms_link_for_certificate_web_view
from
contentstore.utils
import
get_lms_link_for_certificate_web_view
...
@@ -326,6 +327,19 @@ class CertificatesListHandlerTestCase(EventTestMixin, CourseTestCase, Certificat
...
@@ -326,6 +327,19 @@ class CertificatesListHandlerTestCase(EventTestMixin, CourseTestCase, Certificat
self
.
assertEqual
(
response
.
status_code
,
403
)
self
.
assertEqual
(
response
.
status_code
,
403
)
self
.
assertIn
(
"error"
,
response
.
content
)
self
.
assertIn
(
"error"
,
response
.
content
)
def
test_audit_course_mode_is_skipped
(
self
):
"""
Tests audit course mode is skipped when rendering certificates page.
"""
CourseModeFactory
.
create
(
course_id
=
self
.
course
.
id
)
CourseModeFactory
.
create
(
course_id
=
self
.
course
.
id
,
mode_slug
=
'verified'
)
response
=
self
.
client
.
get_html
(
self
.
_url
(),
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertContains
(
response
,
'verified'
)
self
.
assertNotContains
(
response
,
'audit'
)
def
test_assign_unique_identifier_to_certificates
(
self
):
def
test_assign_unique_identifier_to_certificates
(
self
):
"""
"""
Test certificates have unique ids
Test certificates have unique ids
...
...
cms/static/js/certificates/spec/views/certificate_preview_spec.js
View file @
aa529fe0
...
@@ -49,7 +49,7 @@ function(_, $, Course, CertificatePreview, TemplateHelpers, ViewHelpers, AjaxHel
...
@@ -49,7 +49,7 @@ function(_, $, Course, CertificatePreview, TemplateHelpers, ViewHelpers, AjaxHel
appendSetFixtures
(
'<div class="preview-certificate nav-actions"></div>'
);
appendSetFixtures
(
'<div class="preview-certificate nav-actions"></div>'
);
this
.
view
=
new
CertificatePreview
({
this
.
view
=
new
CertificatePreview
({
el
:
$
(
'.preview-certificate'
),
el
:
$
(
'.preview-certificate'
),
course_modes
:
[
'test1'
,
'test2'
,
'test3'
,
'audit'
],
course_modes
:
[
'test1'
,
'test2'
,
'test3'
],
certificate_web_view_url
:
'/users/1/courses/orgX/009/2016?preview=test1'
,
certificate_web_view_url
:
'/users/1/courses/orgX/009/2016?preview=test1'
,
certificate_activation_handler_url
:
'/certificates/activation/'
+
window
.
course
.
id
,
certificate_activation_handler_url
:
'/certificates/activation/'
+
window
.
course
.
id
,
is_active
:
true
is_active
:
true
...
@@ -58,11 +58,6 @@ function(_, $, Course, CertificatePreview, TemplateHelpers, ViewHelpers, AjaxHel
...
@@ -58,11 +58,6 @@ function(_, $, Course, CertificatePreview, TemplateHelpers, ViewHelpers, AjaxHel
});
});
describe
(
'Certificate preview'
,
function
()
{
describe
(
'Certificate preview'
,
function
()
{
it
(
'course mode "audit" should not be render in preview list'
,
function
()
{
expect
(
this
.
view
.
course_modes
.
indexOf
(
'audit'
)
<
0
).
toBe
(
true
);
});
it
(
'course mode event should call when user choose a new mode'
,
function
()
{
it
(
'course mode event should call when user choose a new mode'
,
function
()
{
spyOn
(
this
.
view
,
'courseModeChanged'
);
spyOn
(
this
.
view
,
'courseModeChanged'
);
this
.
view
.
delegateEvents
();
this
.
view
.
delegateEvents
();
...
...
cms/static/js/certificates/views/certificate_preview.js
View file @
aa529fe0
...
@@ -27,8 +27,6 @@ function(_, gettext, BaseView, ViewUtils, NotificationView) {
...
@@ -27,8 +27,6 @@ function(_, gettext, BaseView, ViewUtils, NotificationView) {
},
},
render
:
function
()
{
render
:
function
()
{
// removing the course mode 'audit' from the preview list.
this
.
course_modes
=
_
.
without
(
this
.
course_modes
,
'audit'
);
this
.
$el
.
html
(
this
.
template
({
this
.
$el
.
html
(
this
.
template
({
course_modes
:
this
.
course_modes
,
course_modes
:
this
.
course_modes
,
certificate_web_view_url
:
this
.
certificate_web_view_url
,
certificate_web_view_url
:
this
.
certificate_web_view_url
,
...
...
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