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
dc599c46
Commit
dc599c46
authored
Aug 20, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed test
parent
ff41338c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
3 deletions
+80
-3
lms/djangoapps/django_comment_client/tests.py
+17
-3
lms/static/templates/_content.mustache
+62
-0
lms/templates/discussion/_js_dependencies.html
+1
-0
No files found.
lms/djangoapps/django_comment_client/tests.py
View file @
dc599c46
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.utils
import
unittest
from
django.utils
import
unittest
from
student.models
import
CourseEnrollment
from
django.db.models.signals
import
m2m_changed
,
pre_delete
,
pre_save
,
post_delete
,
post_save
from
django.dispatch.dispatcher
import
_make_id
import
string
import
string
import
random
import
random
from
.permissions
import
student_role
,
moderator_role
,
add_permission
,
has_permission
from
.permissions
import
has_permission
,
assign_default_role
from
.models
import
Role
,
Permission
from
.models
import
Role
,
Permission
...
@@ -11,6 +15,17 @@ class PermissionsTestCase(unittest.TestCase):
...
@@ -11,6 +15,17 @@ class PermissionsTestCase(unittest.TestCase):
return
''
.
join
(
random
.
choice
(
chars
)
for
x
in
range
(
length
))
return
''
.
join
(
random
.
choice
(
chars
)
for
x
in
range
(
length
))
def
setUp
(
self
):
def
setUp
(
self
):
sender_receivers_to_keep
=
[
(
assign_default_role
,
CourseEnrollment
),
]
super
(
PermissionsTestCase
,
self
)
.
setUp
(
sender_receivers_to_keep
=
sender_receivers_to_keep
)
self
.
course_id
=
"MITx/6.002x/2012_Fall"
self
.
moderator_role
=
Role
.
objects
.
get_or_create
(
name
=
"Moderator"
,
course_id
=
self
.
course_id
)[
0
]
self
.
student_role
=
Role
.
objects
.
get_or_create
(
name
=
"Student"
,
course_id
=
self
.
course_id
)[
0
]
self
.
student
=
User
.
objects
.
create
(
username
=
self
.
random_str
(),
self
.
student
=
User
.
objects
.
create
(
username
=
self
.
random_str
(),
password
=
"123456"
,
email
=
"john@yahoo.com"
)
password
=
"123456"
,
email
=
"john@yahoo.com"
)
self
.
moderator
=
User
.
objects
.
create
(
username
=
self
.
random_str
(),
self
.
moderator
=
User
.
objects
.
create
(
username
=
self
.
random_str
(),
...
@@ -33,4 +48,4 @@ class PermissionsTestCase(unittest.TestCase):
...
@@ -33,4 +48,4 @@ class PermissionsTestCase(unittest.TestCase):
self
.
assertTrue
(
has_permission
(
self
.
moderator
,
name
))
self
.
assertTrue
(
has_permission
(
self
.
moderator
,
name
))
add_permission
(
self
.
student
,
name
)
add_permission
(
self
.
student
,
name
)
self
.
assertTrue
(
has_permission
(
self
.
student
,
name
))
self
.
assertTrue
(
has_permission
(
self
.
student
,
name
))
\ No newline at end of file
lms/static/templates/_content.mustache
0 → 100644
View file @
dc599c46
<div
class=
"discussion-content"
>
<div
class=
"discussion-content-wrapper"
>
<div
class=
"discussion-votes"
>
<a
class=
"discussion-vote discussion-vote-up"
href=
"javascript:void(0)"
>
▲
</a>
<div
class=
"discussion-votes-point"
>
{{
content
.
votes
.
point
}}
</div>
<a
class=
"discussion-vote discussion-vote-down"
href=
"javascript:void(0)"
>
▼
</a>
</div>
<div
class=
"discussion-right-wrapper"
>
<ul
class=
"admin-actions"
>
<li><a
href=
"javascript:void(0)"
class=
"admin-endorse"
>
Endorse
</a></li>
<li><a
href=
"javascript:void(0)"
class=
"admin-edit"
>
Edit
</a></li>
<li><a
href=
"javascript:void(0)"
class=
"admin-delete"
>
Delete
</a></li>
{{#
thread
}}
<li><a
href=
"javascript:void(0)"
class=
"admin-openclose"
>
{{
close_thread_text
}}
</a></li>
{{/
thread
}}
</ul>
{{#
thread
}}
<a
class=
"thread-title"
name=
"
{{
content
.
id
}}
"
href=
"javascript:void(0)"
>
{{{
content
.
displayed_title
}}}
</a>
<div
class=
"thread-raw-title"
style=
"display: none"
>
{{{
content
.
title
}}}
</div>
{{/
thread
}}
<div
class=
"discussion-content-view"
>
<a
name=
"
{{
content
.
id
}}
"
style=
"width: 0; height: 0; padding: 0; border: none;"
></a>
<div
class=
"content-body
{{
content
.
type
}}
-body"
id=
"content-body-
{{
content
.
id
}}
"
>
{{{
content
.
displayed_body
}}}
</div>
<div
class=
"content-raw-body
{{
content
.
type
}}
-raw-body"
style=
"display: none"
>
{{{
content
.
body
}}}
</div>
{{#
thread
}}
<div
class=
"thread-tags"
>
{{#
content
.
tags
}}
<a
class=
"thread-tag"
href=
"
{{#
#
url_for_tags
}}{{
.
}}{{/
url_for_tags
}}
"
>
{{
.
}}
</a>
{{/
content
.
tags
}}
</div>
<div
class=
"thread-raw-tags"
style=
"display: none"
>
{{
content
.
raw_tags
}}
</div>
{{/
thread
}}
<div
class=
"info"
>
<div
class=
"comment-time"
>
<span
class=
"timeago"
title=
"
{{
content
.
updated_at
}}
"
>
sometime
</span>
by
{{#
content
.
anonymous
}}
anonymous
{{/
content
.
anonymous
}}
{{^
content
.
anonymous
}}
<a
href=
"
{{#
#
url_for_user
}}{{
content
.
user_id
}}{{/
url_for_user
}}
"
>
{{
content
.
username
}}
</a>
{{/
content
.
anonymous
}}
</div>
<div
class=
"comment-count"
>
{{#
thread
}}
{{#
partial_comments
}}
<a
href=
"javascript:void(0)"
class=
"discussion-show-comments first-time"
>
Show all comments (
{{
content
.
comments_count
}}
total)
</a>
{{/
partial_comments
}}
{{^
partial_comments
}}
<a
href=
"javascript:void(0)"
class=
"discussion-show-comments"
>
Show
{{#
#
pluralize
}}{{
content
.
comments_count
}}
comment
{{/
pluralize
}}
</a>
{{/
partial_comments
}}
{{/
thread
}}
</div>
<ul
class=
"discussion-actions"
>
<li><a
class=
"discussion-link discussion-reply discussion-reply-
{{
content
.
type
}}
"
href=
"javascript:void(0)"
>
Reply
</a></li>
<li><div
class=
"follow-wrapper"
></div></li>
<li><a
class=
"discussion-link discussion-permanent-link"
href=
"javascript:void(0)"
>
Permanent Link
</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
lms/templates/discussion/_js_dependencies.html
View file @
dc599c46
...
@@ -31,3 +31,4 @@
...
@@ -31,3 +31,4 @@
<link
href=
"${static.url('css/vendor/jquery.tagsinput.css')}"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"${static.url('css/vendor/jquery.tagsinput.css')}"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"${static.url('css/vendor/jquery.autocomplete.css')}"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"${static.url('css/vendor/jquery.autocomplete.css')}"
rel=
"stylesheet"
type=
"text/css"
>
<script
type=
"text/template"
id=
"content-template"
src=
"${static.url('templates/_content.mustache')}"
></script>
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