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
21933bfb
Commit
21933bfb
authored
Sep 24, 2014
by
chrisndodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "add an additional tag so we can route zendesk tickets better for white l..."
parent
ba76bbe1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
64 deletions
+8
-64
common/djangoapps/student/tests/test_microsite.py
+0
-2
common/djangoapps/util/tests/test_submit_feedback.py
+1
-46
common/djangoapps/util/views.py
+0
-8
lms/djangoapps/courseware/tests/test_microsites.py
+7
-6
lms/envs/test.py
+0
-2
No files found.
common/djangoapps/student/tests/test_microsite.py
View file @
21933bfb
...
...
@@ -10,8 +10,6 @@ from django.contrib.auth.models import User
FAKE_MICROSITE
=
{
"SITE_NAME"
:
"openedx.localhost"
,
"university"
:
"fakeuniversity"
,
"course_org_filter"
:
"fakeorg"
,
"REGISTRATION_EXTRA_FIELDS"
:
{
"address1"
:
"required"
,
"city"
:
"required"
,
...
...
common/djangoapps/util/tests/test_submit_feedback.py
View file @
21933bfb
...
...
@@ -11,8 +11,6 @@ from zendesk import ZendeskError
import
json
import
mock
from
student.tests.test_microsite
import
fake_microsite_get_value
@mock.patch.dict
(
"django.conf.settings.FEATURES"
,
{
"ENABLE_FEEDBACK_SUBMISSION"
:
True
})
@override_settings
(
ZENDESK_URL
=
"dummy"
,
ZENDESK_USER
=
"dummy"
,
ZENDESK_API_KEY
=
"dummy"
)
...
...
@@ -53,7 +51,7 @@ class SubmitFeedbackTest(TestCase):
HTTP_REFERER
=
"test_referer"
,
HTTP_USER_AGENT
=
"test_user_agent"
,
REMOTE_ADDR
=
"1.2.3.4"
,
SERVER_NAME
=
"test_server"
,
SERVER_NAME
=
"test_server"
)
req
.
user
=
user
return
views
.
submit_feedback
(
req
)
...
...
@@ -191,49 +189,6 @@ class SubmitFeedbackTest(TestCase):
self
.
assertEqual
(
zendesk_mock_instance
.
mock_calls
,
expected_zendesk_calls
)
self
.
_assert_datadog_called
(
datadog_mock
,
with_tags
=
True
)
@mock.patch
(
"microsite_configuration.microsite.get_value"
,
fake_microsite_get_value
)
def
test_valid_request_anon_user_microsite
(
self
,
zendesk_mock_class
,
datadog_mock
):
"""
Test a valid request from an anonymous user to a mocked out microsite
The response should have a 200 (success) status code, and a ticket with
the given information should have been submitted via the Zendesk API with the additional
tag that will come from microsite configuration
"""
zendesk_mock_instance
=
zendesk_mock_class
.
return_value
zendesk_mock_instance
.
create_ticket
.
return_value
=
42
self
.
_test_success
(
self
.
_anon_user
,
self
.
_anon_fields
)
expected_zendesk_calls
=
[
mock
.
call
.
create_ticket
(
{
"ticket"
:
{
"requester"
:
{
"name"
:
"Test User"
,
"email"
:
"test@edx.org"
},
"subject"
:
"a subject"
,
"comment"
:
{
"body"
:
"some details"
},
"tags"
:
[
"test_course"
,
"test_issue"
,
"LMS"
,
"whitelabel_fakeorg"
]
}
}
),
mock
.
call
.
update_ticket
(
42
,
{
"ticket"
:
{
"comment"
:
{
"public"
:
False
,
"body"
:
"Additional information:
\n\n
"
"Client IP: 1.2.3.4
\n
"
"Host: test_server
\n
"
"Page: test_referer
\n
"
"Browser: test_user_agent"
}
}
}
)
]
self
.
assertEqual
(
zendesk_mock_instance
.
mock_calls
,
expected_zendesk_calls
)
self
.
_assert_datadog_called
(
datadog_mock
,
with_tags
=
True
)
def
test_bad_request_auth_user_no_subject
(
self
,
zendesk_mock_class
,
datadog_mock
):
"""Test a request from an authenticated user not specifying `subject`."""
self
.
_test_bad_request_omit_field
(
self
.
_auth_user
,
self
.
_auth_fields
,
"subject"
,
zendesk_mock_class
,
datadog_mock
)
...
...
common/djangoapps/util/views.py
View file @
21933bfb
...
...
@@ -11,7 +11,6 @@ from django.http import (Http404, HttpResponse, HttpResponseNotAllowed,
from
dogapi
import
dog_stats_api
from
edxmako.shortcuts
import
render_to_response
import
zendesk
from
microsite_configuration
import
microsite
import
calc
import
track.views
...
...
@@ -101,13 +100,6 @@ def _record_feedback_in_zendesk(realname, email, subject, details, tags, additio
# Tag all issues with LMS to distinguish channel in Zendesk; requested by student support team
zendesk_tags
=
list
(
tags
.
values
())
+
[
"LMS"
]
# Per edX support, we would like to be able to route white label feedback items
# via tagging
white_label_org
=
microsite
.
get_value
(
'course_org_filter'
)
if
white_label_org
:
zendesk_tags
=
zendesk_tags
+
[
"whitelabel_{org}"
.
format
(
org
=
white_label_org
)]
new_ticket
=
{
"ticket"
:
{
"requester"
:
{
"name"
:
realname
,
"email"
:
email
},
...
...
lms/djangoapps/courseware/tests/test_microsites.py
View file @
21933bfb
...
...
@@ -3,7 +3,6 @@ Tests related to the Microsites feature
"""
from
django.core.urlresolvers
import
reverse
from
django.test.utils
import
override_settings
from
django.conf
import
settings
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
...
@@ -11,6 +10,8 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from
helpers
import
LoginEnrollmentTestCase
from
courseware.tests.modulestore_config
import
TEST_DATA_MIXED_MODULESTORE
MICROSITE_TEST_HOSTNAME
=
'testmicrosite.testserver'
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
class
TestMicrosites
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
...
...
@@ -50,14 +51,14 @@ class TestMicrosites(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
create_account
(
username
,
email
,
password
)
self
.
activate_user
(
email
)
@override_settings
(
SITE_NAME
=
settings
.
MICROSITE_TEST_HOSTNAME
)
@override_settings
(
SITE_NAME
=
MICROSITE_TEST_HOSTNAME
)
def
test_microsite_anonymous_homepage_content
(
self
):
"""
Verify that the homepage, when accessed via a Microsite domain, returns
HTML that reflects the Microsite branding elements
"""
resp
=
self
.
client
.
get
(
'/'
,
HTTP_HOST
=
settings
.
MICROSITE_TEST_HOSTNAME
)
resp
=
self
.
client
.
get
(
'/'
,
HTTP_HOST
=
MICROSITE_TEST_HOSTNAME
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
# assert various branding definitions on this Microsite
...
...
@@ -115,7 +116,7 @@ class TestMicrosites(ModuleStoreTestCase, LoginEnrollmentTestCase):
email
,
password
=
self
.
STUDENT_INFO
[
0
]
self
.
login
(
email
,
password
)
resp
=
self
.
client
.
get
(
reverse
(
'root'
),
HTTP_HOST
=
settings
.
MICROSITE_TEST_HOSTNAME
)
resp
=
self
.
client
.
get
(
reverse
(
'root'
),
HTTP_HOST
=
MICROSITE_TEST_HOSTNAME
)
self
.
assertEquals
(
resp
.
status_code
,
200
)
def
test_redirect_on_homepage_when_has_enrollments
(
self
):
...
...
@@ -129,7 +130,7 @@ class TestMicrosites(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
login
(
email
,
password
)
self
.
enroll
(
self
.
course
,
True
)
resp
=
self
.
client
.
get
(
reverse
(
'root'
),
HTTP_HOST
=
settings
.
MICROSITE_TEST_HOSTNAME
)
resp
=
self
.
client
.
get
(
reverse
(
'root'
),
HTTP_HOST
=
MICROSITE_TEST_HOSTNAME
)
self
.
assertEquals
(
resp
.
status_code
,
302
)
def
test_microsite_course_enrollment
(
self
):
...
...
@@ -145,7 +146,7 @@ class TestMicrosites(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
enroll
(
self
.
course_outside_microsite
,
True
)
# Access the microsite dashboard and make sure the right courses appear
resp
=
self
.
client
.
get
(
reverse
(
'dashboard'
),
HTTP_HOST
=
settings
.
MICROSITE_TEST_HOSTNAME
)
resp
=
self
.
client
.
get
(
reverse
(
'dashboard'
),
HTTP_HOST
=
MICROSITE_TEST_HOSTNAME
)
self
.
assertContains
(
resp
,
'Robot_Super_Course'
)
self
.
assertNotContains
(
resp
,
'Robot_Course_Outside_Microsite'
)
...
...
lms/envs/test.py
View file @
21933bfb
...
...
@@ -346,8 +346,6 @@ MICROSITE_CONFIGURATION = {
}
}
MICROSITE_ROOT_DIR
=
COMMON_ROOT
/
'test'
/
'test_microsites'
MICROSITE_TEST_HOSTNAME
=
'testmicrosite.testserver'
FEATURES
[
'USE_MICROSITES'
]
=
True
# add extra template directory for test-only templates
...
...
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