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
1223d88e
Commit
1223d88e
authored
Jun 17, 2015
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add professional enrollments to the instructor dashboard.
parent
fa4dcdeb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletions
+22
-1
lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py
+19
-1
lms/templates/instructor/instructor_dashboard_2/course_info.html
+3
-0
No files found.
lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py
View file @
1223d88e
...
...
@@ -13,12 +13,13 @@ from courseware.tabs import get_course_tab_list
from
courseware.tests.factories
import
UserFactory
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
from
student.tests.factories
import
AdminFactory
,
UserFactory
from
student.tests.factories
import
AdminFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
shoppingcart.models
import
PaidCourseRegistration
,
Order
,
CourseRegCodeItem
from
course_modes.models
import
CourseMode
from
student.roles
import
CourseFinanceAdminRole
from
student.models
import
CourseEnrollment
@ddt.ddt
...
...
@@ -117,10 +118,26 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
assertTrue
(
'<td>Verified</td>'
in
response
.
content
)
self
.
assertTrue
(
'<td>Audit</td>'
in
response
.
content
)
self
.
assertTrue
(
'<td>Honor</td>'
in
response
.
content
)
self
.
assertTrue
(
'<td>Professional</td>'
in
response
.
content
)
# dashboard link hidden
self
.
assertFalse
(
self
.
get_dashboard_enrollment_message
()
in
response
.
content
)
@patch.dict
(
settings
.
FEATURES
,
{
'DISPLAY_ANALYTICS_ENROLLMENTS'
:
True
})
@override_settings
(
ANALYTICS_DASHBOARD_URL
=
''
)
def
test_show_enrollment_data_for_prof_ed
(
self
):
# Create both "professional" (meaning professional + verification)
# and "no-id-professional" (meaning professional without verification)
# These should be aggregated for display purposes.
users
=
[
UserFactory
()
for
_
in
range
(
2
)]
CourseEnrollment
.
enroll
(
users
[
0
],
self
.
course
.
id
,
mode
=
"professional"
)
CourseEnrollment
.
enroll
(
users
[
1
],
self
.
course
.
id
,
mode
=
"no-id-professional"
)
response
=
self
.
client
.
get
(
self
.
url
)
# Check that the number of professional enrollments is two
self
.
assertContains
(
response
,
"<td>Professional</td><td>2</td>"
)
@patch.dict
(
settings
.
FEATURES
,
{
'DISPLAY_ANALYTICS_ENROLLMENTS'
:
False
})
@override_settings
(
ANALYTICS_DASHBOARD_URL
=
'http://example.com'
)
@override_settings
(
ANALYTICS_DASHBOARD_NAME
=
'Example'
)
...
...
@@ -134,6 +151,7 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
assertFalse
(
'<td>Verified</td>'
in
response
.
content
)
self
.
assertFalse
(
'<td>Audit</td>'
in
response
.
content
)
self
.
assertFalse
(
'<td>Honor</td>'
in
response
.
content
)
self
.
assertFalse
(
'<td>Professional</td>'
in
response
.
content
)
# link to dashboard shown
expected_message
=
self
.
get_dashboard_enrollment_message
()
...
...
lms/templates/instructor/instructor_dashboard_2/course_info.html
View file @
1223d88e
...
...
@@ -20,6 +20,9 @@
<tr>
<td>
${_("Honor")}
</td><td>
${modes['honor']}
</td>
</tr>
<tr>
<td>
${_("Professional")}
</td><td>
${modes['professional'] + modes['no-id-professional']}
</td>
</tr>
<tr
style=
"color:green;border-top:1px solid #000"
>
<td
style=
"padding-top:10px;"
><b>
${_("Total")}
</b></td><td
style=
"padding-top:10px;"
><b>
${modes['total']}
</b></td>
</tr>
...
...
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