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
8d40dcd0
Commit
8d40dcd0
authored
Jun 09, 2016
by
Awais Jibran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix remove user from cert-exception list
ECOM-4650
parent
1e67ec66
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
12 deletions
+42
-12
common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py
+28
-0
lms/static/js/certificates/models/certificate_exception.js
+2
-4
lms/static/js/certificates/views/certificate_whitelist_editor.js
+11
-7
lms/static/js/spec/instructor_dashboard/certificates_exception_spec.js
+1
-1
No files found.
common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py
View file @
8d40dcd0
...
...
@@ -831,6 +831,34 @@ class CertificatesTest(BaseInstructorDashboardTest):
self
.
assertIn
(
self
.
user_name
,
self
.
certificates_section
.
last_certificate_exception
.
text
)
self
.
assertIn
(
notes
,
self
.
certificates_section
.
last_certificate_exception
.
text
)
def
test_remove_certificate_exception_on_page_reload
(
self
):
"""
Scenario: On the Certificates tab of the Instructor Dashboard, Instructor can remove added certificate
exceptions from the list.
Given that I am on the Certificates tab on the Instructor Dashboard
When I fill in student username and notes fields and click 'Add Exception' button
Then new certificate exception should be visible in certificate exceptions list
Revisit the page to make sure exceptions are synced.
Remove the user from the exception list should remove the user from the list.
"""
notes
=
'Test Notes'
# Add a student to Certificate exception list
self
.
certificates_section
.
add_certificate_exception
(
self
.
user_name
,
notes
)
self
.
assertIn
(
self
.
user_name
,
self
.
certificates_section
.
last_certificate_exception
.
text
)
self
.
assertIn
(
notes
,
self
.
certificates_section
.
last_certificate_exception
.
text
)
# Verify that added exceptions are also synced with backend
# Revisit Page
self
.
certificates_section
.
refresh
()
# Remove Certificate Exception
self
.
certificates_section
.
remove_first_certificate_exception
()
self
.
assertNotIn
(
self
.
user_name
,
self
.
certificates_section
.
last_certificate_exception
.
text
)
self
.
assertNotIn
(
notes
,
self
.
certificates_section
.
last_certificate_exception
.
text
)
def
test_instructor_can_remove_certificate_exception
(
self
):
"""
Scenario: On the Certificates tab of the Instructor Dashboard, Instructor can remove added certificate
...
...
lms/static/js/certificates/models/certificate_exception.js
View file @
8d40dcd0
...
...
@@ -24,11 +24,9 @@
certificate_generated
:
''
,
notes
:
''
},
url
:
function
()
{
return
this
.
get
(
'url'
);
initialize
:
function
(
attributes
,
options
)
{
this
.
url
=
options
.
url
;
},
validate
:
function
(
attrs
){
if
(
!
str
.
trim
(
attrs
.
user_name
)
&&
!
str
.
trim
(
attrs
.
user_email
))
{
return
gettext
(
'Student username/email field is required and can not be empty. '
+
...
...
lms/static/js/certificates/views/certificate_whitelist_editor.js
View file @
8d40dcd0
...
...
@@ -44,13 +44,17 @@
model
=
{
user_name
:
user_name
};
}
var
certificate_exception
=
new
CertificateExceptionModel
({
url
:
this
.
collection
.
url
,
user_name
:
user_name
,
user_email
:
user_email
,
notes
:
notes
,
new
:
true
});
var
certificate_exception
=
new
CertificateExceptionModel
(
{
user_name
:
user_name
,
user_email
:
user_email
,
notes
:
notes
,
new
:
true
},
{
url
:
this
.
collection
.
url
}
);
var
message
=
""
;
if
(
this
.
collection
.
findWhere
(
model
)){
...
...
lms/static/js/spec/instructor_dashboard/certificates_exception_spec.js
View file @
8d40dcd0
...
...
@@ -30,7 +30,7 @@ define([
beforeEach
(
function
()
{
certificate_exception
=
new
CertificateExceptionModel
({
user_name
:
'test_user'
});
certificate_exception
=
new
CertificateExceptionModel
({
user_name
:
'test_user'
}
,
{
url
:
'test/url/'
}
);
certificate_exception
.
set
({
notes
:
"Test notes"
});
...
...
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