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
a0ccba6b
Commit
a0ccba6b
authored
Jan 28, 2013
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1366 from MITx/bugfix/victor/fix-cohorts-test-in-cms
make tests pass with cms config as well as lms
parents
2e19de2d
734a8bd6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletions
+20
-1
common/djangoapps/course_groups/tests/tests.py
+20
-1
No files found.
common/djangoapps/course_groups/tests/tests.py
View file @
a0ccba6b
...
...
@@ -10,6 +10,25 @@ from course_groups.cohorts import (get_cohort, get_course_cohorts,
from
xmodule.modulestore.django
import
modulestore
,
_MODULESTORES
# NOTE: running this with the lms.envs.test config works without
# manually overriding the modulestore. However, running with
# cms.envs.test doesn't.
def
xml_store_config
(
data_dir
):
return
{
'default'
:
{
'ENGINE'
:
'xmodule.modulestore.xml.XMLModuleStore'
,
'OPTIONS'
:
{
'data_dir'
:
data_dir
,
'default_class'
:
'xmodule.hidden_module.HiddenDescriptor'
,
}
}
}
TEST_DATA_DIR
=
settings
.
COMMON_TEST_DATA_ROOT
TEST_DATA_XML_MODULESTORE
=
xml_store_config
(
TEST_DATA_DIR
)
@override_settings
(
MODULESTORE
=
TEST_DATA_XML_MODULESTORE
)
class
TestCohorts
(
django
.
test
.
TestCase
):
...
...
@@ -77,7 +96,7 @@ class TestCohorts(django.test.TestCase):
course
=
modulestore
()
.
get_course
(
"edX/toy/2012_Fall"
)
self
.
assertEqual
(
course
.
id
,
"edX/toy/2012_Fall"
)
self
.
assertFalse
(
course
.
is_cohorted
)
user
=
User
.
objects
.
create
(
username
=
"test"
,
email
=
"a@b.com"
)
other_user
=
User
.
objects
.
create
(
username
=
"test2"
,
email
=
"a2@b.com"
)
...
...
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