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
03ed0347
Commit
03ed0347
authored
Sep 27, 2016
by
asadiqbal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- WL-612
parent
20fc5bae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
lms/djangoapps/instructor/tests/test_ecommerce.py
+21
-1
lms/djangoapps/instructor/views/instructor_dashboard.py
+4
-1
openedx/core/djangoapps/site_configuration/tests/mixins.py
+1
-0
No files found.
lms/djangoapps/instructor/tests/test_ecommerce.py
View file @
03ed0347
...
...
@@ -15,10 +15,11 @@ from shoppingcart.models import Coupon, CourseRegistrationCode
from
student.tests.factories
import
AdminFactory
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
openedx.core.djangoapps.site_configuration.tests.mixins
import
SiteMixin
@attr
(
shard
=
1
)
class
TestECommerceDashboardViews
(
SharedModuleStoreTestCase
):
class
TestECommerceDashboardViews
(
S
iteMixin
,
S
haredModuleStoreTestCase
):
"""
Check for E-commerce view on the new instructor dashboard
"""
...
...
@@ -53,6 +54,25 @@ class TestECommerceDashboardViews(SharedModuleStoreTestCase):
# Coupons should show up for White Label sites with priced honor modes.
self
.
assertIn
(
'Coupon Code List'
,
response
.
content
)
def
test_reports_section_under_e_commerce_tab
(
self
):
"""
Test reports section, under E-commerce Tab, is in the Instructor Dashboard
"""
self
.
use_site
(
site
=
self
.
site_other
)
self
.
client
.
login
(
username
=
self
.
instructor
.
username
,
password
=
"test"
)
response
=
self
.
client
.
get
(
self
.
url
)
self
.
assertIn
(
self
.
e_commerce_link
,
response
.
content
)
self
.
assertIn
(
'Create Enrollment Report'
,
response
.
content
)
def
test_reports_section_not_under_e_commerce_tab
(
self
):
"""
Test reports section, under E-commerce Tab, should not be available in the Instructor Dashboard with default
value
"""
response
=
self
.
client
.
get
(
self
.
url
)
self
.
assertIn
(
self
.
e_commerce_link
,
response
.
content
)
self
.
assertNotIn
(
'Create Enrollment Report'
,
response
.
content
)
def
test_user_has_finance_admin_rights_in_e_commerce_tab
(
self
):
response
=
self
.
client
.
get
(
self
.
url
)
self
.
assertIn
(
self
.
e_commerce_link
,
response
.
content
)
...
...
lms/djangoapps/instructor/views/instructor_dashboard.py
View file @
03ed0347
...
...
@@ -53,6 +53,7 @@ from util.date_utils import get_default_time_display
from
class_dashboard.dashboard_data
import
get_section_display_name
,
get_array_section_has_problem
from
.tools
import
get_units_with_due_date
,
title_or_url
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
openedx.core.djangoapps.site_configuration
import
helpers
as
configuration_helpers
from
openedx.core.djangolib.markup
import
HTML
,
Text
...
...
@@ -103,6 +104,8 @@ def instructor_dashboard_2(request, course_id):
is_white_label
=
CourseMode
.
is_white_label
(
course_key
)
reports_enabled
=
configuration_helpers
.
get_value
(
'SHOW_ECOMMERCE_REPORTS'
,
False
)
sections
=
[
_section_course_info
(
course
,
access
),
_section_membership
(
course
,
access
,
is_white_label
),
...
...
@@ -151,7 +154,7 @@ def instructor_dashboard_2(request, course_id):
# Gate access to Ecommerce tab
if
course_mode_has_price
and
(
access
[
'finance_admin'
]
or
access
[
'sales_admin'
]):
sections
.
append
(
_section_e_commerce
(
course
,
access
,
paid_modes
[
0
],
is_white_label
,
is_white_label
))
sections
.
append
(
_section_e_commerce
(
course
,
access
,
paid_modes
[
0
],
is_white_label
,
reports_enabled
))
# Gate access to Special Exam tab depending if either timed exams or proctored exams
# are enabled in the course
...
...
openedx/core/djangoapps/site_configuration/tests/mixins.py
View file @
03ed0347
...
...
@@ -30,6 +30,7 @@ class SiteMixin(object):
"SITE_NAME"
:
self
.
site_other
.
domain
,
"course_org_filter"
:
"fakeOtherX"
,
"ENABLE_MKTG_SITE"
:
True
,
"SHOW_ECOMMERCE_REPORTS"
:
True
,
"MKTG_URLS"
:
{
"ROOT"
:
"https://marketing.fakeother"
,
"ABOUT"
:
"/fake-about"
...
...
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