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
5f73c178
Commit
5f73c178
authored
Oct 09, 2014
by
Waqas Khalid
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5418 from mlkwaqas/waqas/tnl336-forum-search-unicode-error
Forum shouldn't cuase error while searching unicode
parents
d2c3e1eb
c2ecaa7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
lms/djangoapps/django_comment_client/forum/tests.py
+23
-0
No files found.
lms/djangoapps/django_comment_client/forum/tests.py
View file @
5f73c178
...
...
@@ -898,6 +898,29 @@ class ForumFormDiscussionUnicodeTestCase(ModuleStoreTestCase, UnicodeTestMixin):
self
.
assertEqual
(
response_data
[
"discussion_data"
][
0
][
"title"
],
text
)
self
.
assertEqual
(
response_data
[
"discussion_data"
][
0
][
"body"
],
text
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
class
ForumDiscussionSearchUnicodeTestCase
(
ModuleStoreTestCase
,
UnicodeTestMixin
):
def
setUp
(
self
):
self
.
course
=
CourseFactory
.
create
()
self
.
student
=
UserFactory
.
create
()
CourseEnrollmentFactory
(
user
=
self
.
student
,
course_id
=
self
.
course
.
id
)
@patch
(
'lms.lib.comment_client.utils.requests.request'
)
def
_test_unicode_data
(
self
,
text
,
mock_request
):
mock_request
.
side_effect
=
make_mock_request_impl
(
text
)
data
=
{
"ajax"
:
1
,
"text"
:
text
,
}
request
=
RequestFactory
()
.
get
(
"dummy_url"
,
data
)
request
.
user
=
self
.
student
request
.
META
[
"HTTP_X_REQUESTED_WITH"
]
=
"XMLHttpRequest"
# so request.is_ajax() == True
response
=
views
.
forum_form_discussion
(
request
,
self
.
course
.
id
.
to_deprecated_string
())
self
.
assertEqual
(
response
.
status_code
,
200
)
response_data
=
json
.
loads
(
response
.
content
)
self
.
assertEqual
(
response_data
[
"discussion_data"
][
0
][
"title"
],
text
)
self
.
assertEqual
(
response_data
[
"discussion_data"
][
0
][
"body"
],
text
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
class
SingleThreadUnicodeTestCase
(
ModuleStoreTestCase
,
UnicodeTestMixin
):
...
...
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