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
1f64506c
Commit
1f64506c
authored
Aug 28, 2015
by
David Ormsbee
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9507 from edx/ormsbee/faster_tests_comment_client
Convert CohortedTestCase to use SharedModuleStoreTestCase.
parents
a8cc5850
9bac3579
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
lms/djangoapps/django_comment_client/tests/utils.py
+15
-10
No files found.
lms/djangoapps/django_comment_client/tests/utils.py
View file @
1f64506c
...
...
@@ -8,23 +8,32 @@ from django_comment_common.models import Role
from
django_comment_common.utils
import
seed_permissions_roles
from
student.tests.factories
import
CourseEnrollmentFactory
,
UserFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
Shared
ModuleStoreTestCase
class
CohortedTestCase
(
ModuleStoreTestCase
):
class
CohortedTestCase
(
Shared
ModuleStoreTestCase
):
"""
Sets up a course with a student, a moderator and their cohorts.
"""
@classmethod
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
"ENABLE_DISCUSSION_SERVICE"
:
True
})
def
setUp
(
self
):
super
(
CohortedTestCase
,
self
)
.
setUp
()
self
.
course
=
CourseFactory
.
create
(
def
setUpClass
(
cls
):
super
(
CohortedTestCase
,
cls
)
.
setUpClass
()
cls
.
course
=
CourseFactory
.
create
(
cohort_config
=
{
"cohorted"
:
True
,
"cohorted_discussions"
:
[
"cohorted_topic"
]
}
)
cls
.
course
.
discussion_topics
[
"cohorted topic"
]
=
{
"id"
:
"cohorted_topic"
}
cls
.
course
.
discussion_topics
[
"non-cohorted topic"
]
=
{
"id"
:
"non_cohorted_topic"
}
fake_user_id
=
1
cls
.
store
.
update_item
(
cls
.
course
,
fake_user_id
)
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
"ENABLE_DISCUSSION_SERVICE"
:
True
})
def
setUp
(
self
):
super
(
CohortedTestCase
,
self
)
.
setUp
()
self
.
student_cohort
=
CohortFactory
.
create
(
name
=
"student_cohort"
,
course_id
=
self
.
course
.
id
...
...
@@ -33,10 +42,6 @@ class CohortedTestCase(ModuleStoreTestCase):
name
=
"moderator_cohort"
,
course_id
=
self
.
course
.
id
)
self
.
course
.
discussion_topics
[
"cohorted topic"
]
=
{
"id"
:
"cohorted_topic"
}
self
.
course
.
discussion_topics
[
"non-cohorted topic"
]
=
{
"id"
:
"non_cohorted_topic"
}
self
.
store
.
update_item
(
self
.
course
,
self
.
user
.
id
)
seed_permissions_roles
(
self
.
course
.
id
)
self
.
student
=
UserFactory
.
create
()
self
.
moderator
=
UserFactory
.
create
()
...
...
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