Commit 2337b80a by Cliff Dyer Committed by GitHub

Merge pull request #12722 from edx/tnl/splittest-zerogroup-test

modified tests to directly address split test group 0 issues.
parents 9eaa1acd 26966504
...@@ -31,7 +31,7 @@ class SplitTestTransformerTestCase(CourseStructureTestCase): ...@@ -31,7 +31,7 @@ class SplitTestTransformerTestCase(CourseStructureTestCase):
super(SplitTestTransformerTestCase, self).setUp() super(SplitTestTransformerTestCase, self).setUp()
# Set up user partitions and groups. # Set up user partitions and groups.
self.groups = [Group(1, 'Group 1'), Group(2, 'Group 2'), Group(3, 'Group 3')] self.groups = [Group(0, 'Group 0'), Group(1, 'Group 1'), Group(2, 'Group 2')]
self.split_test_user_partition_id = self.TEST_PARTITION_ID self.split_test_user_partition_id = self.TEST_PARTITION_ID
self.split_test_user_partition = UserPartition( self.split_test_user_partition = UserPartition(
id=self.split_test_user_partition_id, id=self.split_test_user_partition_id,
...@@ -105,9 +105,9 @@ class SplitTestTransformerTestCase(CourseStructureTestCase): ...@@ -105,9 +105,9 @@ class SplitTestTransformerTestCase(CourseStructureTestCase):
'metadata': {'category': 'split_test'}, 'metadata': {'category': 'split_test'},
'user_partition_id': self.TEST_PARTITION_ID, 'user_partition_id': self.TEST_PARTITION_ID,
'group_id_to_child': { 'group_id_to_child': {
'1': location('E'), '0': location('E'),
'2': location('F'), '1': location('F'),
'3': location('G'), '2': location('G'),
}, },
'#children': [{'#type': 'vertical', '#ref': 'G'}], '#children': [{'#type': 'vertical', '#ref': 'G'}],
}, },
...@@ -130,8 +130,8 @@ class SplitTestTransformerTestCase(CourseStructureTestCase): ...@@ -130,8 +130,8 @@ class SplitTestTransformerTestCase(CourseStructureTestCase):
'metadata': {'category': 'split_test'}, 'metadata': {'category': 'split_test'},
'user_partition_id': self.TEST_PARTITION_ID, 'user_partition_id': self.TEST_PARTITION_ID,
'group_id_to_child': { 'group_id_to_child': {
'2': location('M'), '1': location('M'),
'3': location('N'), '2': location('N'),
}, },
'#parents': ['F'], '#parents': ['F'],
'#children': [ '#children': [
...@@ -145,8 +145,8 @@ class SplitTestTransformerTestCase(CourseStructureTestCase): ...@@ -145,8 +145,8 @@ class SplitTestTransformerTestCase(CourseStructureTestCase):
'metadata': {'category': 'split_test'}, 'metadata': {'category': 'split_test'},
'user_partition_id': self.TEST_PARTITION_ID, 'user_partition_id': self.TEST_PARTITION_ID,
'group_id_to_child': { 'group_id_to_child': {
'1': location('H'), '0': location('H'),
'2': location('I'), '1': location('I'),
}, },
'#children': [ '#children': [
{'#type': 'vertical', '#ref': 'I'}, {'#type': 'vertical', '#ref': 'I'},
...@@ -172,15 +172,15 @@ class SplitTestTransformerTestCase(CourseStructureTestCase): ...@@ -172,15 +172,15 @@ class SplitTestTransformerTestCase(CourseStructureTestCase):
@ddt.data( @ddt.data(
# Note: Theoretically, block E should be accessible by users # Note: Theoretically, block E should be accessible by users
# not in Group 1, since there's an open path through block A. # not in Group 0, since there's an open path through block A.
# Since the split_test transformer automatically sets the block # Since the split_test transformer automatically sets the block
# access on its children, it bypasses the paths via other # access on its children, it bypasses the paths via other
# parents. However, we don't think this is a use case we need to # parents. However, we don't think this is a use case we need to
# support for split_test components (since they are now deprecated # support for split_test components (since they are now deprecated
# in favor of content groups and user partitions). # in favor of content groups and user partitions).
(1, ('course', 'A', 'D', 'E', 'H', 'L', 'O', 'P',)), (0, ('course', 'A', 'D', 'E', 'H', 'L', 'O', 'P',)),
(2, ('course', 'A', 'D', 'F', 'J', 'M', 'I',)), (1, ('course', 'A', 'D', 'F', 'J', 'M', 'I',)),
(3, ('course', 'A', 'D', 'G', 'O',)), (2, ('course', 'A', 'D', 'G', 'O',)),
) )
@ddt.unpack @ddt.unpack
def test_user(self, group_id, expected_blocks): def test_user(self, group_id, expected_blocks):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment