Skip to content

Commit

Permalink
test: adds untagged blocks with children
Browse files Browse the repository at this point in the history
ensures that untagged elements and their children are included in results
  • Loading branch information
pomegranited committed Jan 30, 2024
1 parent 35a3d2b commit 1e13f54
Showing 1 changed file with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,37 @@ def setUp(self):
assert self.expected_tagged_xblock.children is not None # type guard
self.expected_tagged_xblock.children.append(tagged_sequential)

# Untagged blocks
sequential2 = BlockFactory.create(
parent=self.course,
category="sequential",
display_name="untagged sequential",
)
untagged_sequential = TaggedContent(
display_name="untagged sequential",
block_id="block-v1:orgA+test_course+test_run+type@sequential+block@untagged_sequential",
category="sequential",
children=[],
object_tags={},
)
assert self.expected_tagged_xblock.children is not None # type guard
self.expected_tagged_xblock.children.append(untagged_sequential)
BlockFactory.create(
parent=sequential2,
category="vertical",
display_name="untagged vertical",
)
untagged_vertical = TaggedContent(
display_name="untagged vertical",
block_id="block-v1:orgA+test_course+test_run+type@vertical+block@untagged_vertical",
category="vertical",
children=[],
object_tags={},
)
assert untagged_sequential.children is not None # type guard
untagged_sequential.children.append(untagged_vertical)
# /Untagged blocks

vertical = BlockFactory.create(
parent=self.sequential,
category="vertical",
Expand Down Expand Up @@ -191,6 +222,8 @@ def setUp(self):
(tagged_vertical, 2),
(tagged_vertical2, 2),
(tagged_text, 3),
(untagged_sequential, 1),
(untagged_vertical, 2),
]


Expand Down

0 comments on commit 1e13f54

Please sign in to comment.