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
e7fbf132
Commit
e7fbf132
authored
Aug 11, 2014
by
Tim Babych
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4778 from edx/tim/improve-python-group-configuration-tests
Use UrlResetMixin to test GroupConfiguration feature
parents
05bddae3
06cb6008
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
cms/djangoapps/contentstore/views/tests/test_group_configurations.py
+11
-11
No files found.
cms/djangoapps/contentstore/views/tests/test_group_configurations.py
View file @
e7fbf132
...
...
@@ -2,12 +2,12 @@
Group Configuration Tests.
"""
import
json
from
unittest
import
skipUnless
from
django.conf
import
settings
from
mock
import
patch
from
contentstore.utils
import
reverse_course_url
from
contentstore.views.component
import
SPLIT_TEST_COMPONENT_TYPE
from
contentstore.views.course
import
GroupConfiguration
from
contentstore.tests.utils
import
CourseTestCase
from
util.testing
import
UrlResetMixin
from
xmodule.partitions.partitions
import
Group
,
UserPartition
from
xmodule.modulestore.tests.factories
import
ItemFactory
...
...
@@ -137,11 +137,11 @@ class GroupConfigurationsBaseTestCase(object):
# pylint: disable=no-member
@skipUnless
(
settings
.
FEATURES
.
get
(
'ENABLE_GROUP_CONFIGURATIONS'
),
'Tests Group Configurations feature'
)
class
GroupConfigurationsListHandlerTestCase
(
CourseTestCase
,
GroupConfigurationsBaseTestCase
,
HelperMethods
):
class
GroupConfigurationsListHandlerTestCase
(
UrlResetMixin
,
CourseTestCase
,
GroupConfigurationsBaseTestCase
,
HelperMethods
):
"""
Test cases for group_configurations_list_handler.
"""
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
"ENABLE_GROUP_CONFIGURATIONS"
:
True
})
def
setUp
(
self
):
"""
Set up GroupConfigurationsListHandlerTestCase.
...
...
@@ -233,14 +233,14 @@ class GroupConfigurationsListHandlerTestCase(CourseTestCase, GroupConfigurations
# pylint: disable=no-member
@skipUnless
(
settings
.
FEATURES
.
get
(
'ENABLE_GROUP_CONFIGURATIONS'
),
'Tests Group Configurations feature'
)
class
GroupConfigurationsDetailHandlerTestCase
(
CourseTestCase
,
GroupConfigurationsBaseTestCase
,
HelperMethods
):
class
GroupConfigurationsDetailHandlerTestCase
(
UrlResetMixin
,
CourseTestCase
,
GroupConfigurationsBaseTestCase
,
HelperMethods
):
"""
Test cases for group_configurations_detail_handler.
"""
ID
=
000000000000
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
"ENABLE_GROUP_CONFIGURATIONS"
:
True
})
def
setUp
(
self
):
"""
Set up GroupConfigurationsDetailHandlerTestCase.
...
...
@@ -387,11 +387,11 @@ class GroupConfigurationsDetailHandlerTestCase(CourseTestCase, GroupConfiguratio
# pylint: disable=no-member
@skipUnless
(
settings
.
FEATURES
.
get
(
'ENABLE_GROUP_CONFIGURATIONS'
),
'Tests Group Configurations feature'
)
class
GroupConfigurationsUsageInfoTestCase
(
CourseTestCase
,
HelperMethods
):
class
GroupConfigurationsUsageInfoTestCase
(
UrlResetMixin
,
CourseTestCase
,
HelperMethods
):
"""
Tests for usage information of configurations.
"""
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
"ENABLE_GROUP_CONFIGURATIONS"
:
True
})
def
setUp
(
self
):
"""
Set up group configurations and split test module.
...
...
@@ -439,7 +439,7 @@ class GroupConfigurationsUsageInfoTestCase(CourseTestCase, HelperMethods):
{
u'id'
:
2
,
u'name'
:
u'Group C'
,
u'version'
:
1
},
],
u'usage'
:
[{
'url'
:
'/
unit
/i4x://MITx/999/vertical/Test_Unit_0'
,
'url'
:
'/
container
/i4x://MITx/999/vertical/Test_Unit_0'
,
'label'
:
'Test Unit 0 / Test Content Experiment 0'
,
}],
},
{
...
...
@@ -479,10 +479,10 @@ class GroupConfigurationsUsageInfoTestCase(CourseTestCase, HelperMethods):
{
u'id'
:
2
,
u'name'
:
u'Group C'
,
u'version'
:
1
},
],
u'usage'
:
[{
'url'
:
'/
unit
/i4x://MITx/999/vertical/Test_Unit_0'
,
'url'
:
'/
container
/i4x://MITx/999/vertical/Test_Unit_0'
,
'label'
:
'Test Unit 0 / Test Content Experiment 0'
,
},
{
'url'
:
'/
unit
/i4x://MITx/999/vertical/Test_Unit_1'
,
'url'
:
'/
container
/i4x://MITx/999/vertical/Test_Unit_1'
,
'label'
:
'Test Unit 1 / Test Content Experiment 1'
,
}],
}]
...
...
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