Skip to content

Commit

Permalink
test: Adds "deleted" object tags to ensure they are omitted from results
Browse files Browse the repository at this point in the history
  • Loading branch information
pomegranited committed Jan 30, 2024
1 parent 30e06d0 commit 35a3d2b
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from xmodule.modulestore.tests.factories import BlockFactory, CourseFactory

from .... import api
from ....models import ContentObjectTag
from ..objecttag_export_helpers import TaggedContent, build_object_tree_with_objecttags, iterate_with_level


Expand Down Expand Up @@ -168,6 +169,21 @@ def setUp(self):
assert tagged_vertical2.children is not None # type guard
tagged_vertical2.children.append(tagged_text)

# Create "deleted" object tags, which will be omitted from the results.
for object_id in (
self.course.id,
self.sequential.location,
vertical.location,
html.location,
):
ContentObjectTag.objects.create(
object_id=str(object_id),
taxonomy=None,
tag=None,
_value="deleted tag",
_name="deleted taxonomy",
)

self.all_object_tags, _ = api.get_all_object_tags(self.course.id)
self.expected_tagged_content_list = [
(self.expected_tagged_xblock, 0),
Expand Down

0 comments on commit 35a3d2b

Please sign in to comment.