Skip to content

Commit 14486bf

Browse files
committed
fix: Broken tests
1 parent e7f93da commit 14486bf

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

tests/openedx_content/applets/containers/test_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ def test_contains_unpublished_changes_queries(
925925
assert containers_api.contains_unpublished_changes(grandparent.id)
926926

927927
# Publish grandparent and all its descendants:
928-
with django_assert_num_queries(135): # TODO: investigate as this seems high!
928+
with django_assert_num_queries(136): # TODO: investigate as this seems high!
929929
publish_entity(grandparent)
930930

931931
# Tests:
@@ -1244,7 +1244,7 @@ def test_uninstalled_publish(
12441244
"""Simple test of publishing a container of uninstalled type, plus its child, and reviewing the publish log"""
12451245
# Publish container_of_uninstalled_type (and child_entity1). Should not affect anything else,
12461246
# but we should see "child_entity1" omitted from the subsequent publish.
1247-
with django_assert_num_queries(49):
1247+
with django_assert_num_queries(50):
12481248
publish_log = publish_entity(container_of_uninstalled_type)
12491249
# Nothing else should have been affected by the publish:
12501250
assert list(publish_log.records.order_by("entity__pk").values_list("entity__key", flat=True)) == [
@@ -1282,7 +1282,7 @@ def test_deep_publish_log(
12821282
)
12831283
# Publish container_of_uninstalled_type (and child_entity1). Should not affect anything else,
12841284
# but we should see "child_entity1" omitted from the subsequent publish.
1285-
with django_assert_num_queries(49):
1285+
with django_assert_num_queries(50):
12861286
publish_log = publish_entity(container_of_uninstalled_type)
12871287
# Nothing else should have been affected by the publish:
12881288
assert list(publish_log.records.order_by("entity__pk").values_list("entity__key", flat=True)) == [
@@ -1291,7 +1291,7 @@ def test_deep_publish_log(
12911291
]
12921292

12931293
# Publish great_grandparent. Should publish the whole tree.
1294-
with django_assert_num_queries(126):
1294+
with django_assert_num_queries(127):
12951295
publish_log = publish_entity(great_grandparent)
12961296
assert list(publish_log.records.order_by("entity__pk").values_list("entity__key", flat=True)) == [
12971297
"child_entity2",

tests/openedx_content/applets/sections/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def test_section_queries(self) -> None:
155155
"""
156156
with self.assertNumQueries(37):
157157
section = self.create_section_with_subsections([self.subsection_1, self.subsection_2_v1])
158-
with self.assertNumQueries(160):
158+
with self.assertNumQueries(161):
159159
content_api.publish_from_drafts(
160160
self.learning_package.id,
161161
draft_qset=content_api.get_all_drafts(self.learning_package.id).filter(entity=section.id),

tests/openedx_content/applets/subsections/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def test_subsection_queries(self) -> None:
133133
"""
134134
with self.assertNumQueries(37):
135135
subsection = self.create_subsection_with_units([self.unit_1, self.unit_1_v1])
136-
with self.assertNumQueries(102): # TODO: this seems high?
136+
with self.assertNumQueries(103): # TODO: this seems high?
137137
content_api.publish_from_drafts(
138138
self.learning_package.id,
139139
draft_qset=content_api.get_all_drafts(self.learning_package.id).filter(entity=subsection.id),

tests/openedx_content/applets/units/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def test_unit_queries(self) -> None:
134134
"""
135135
with self.assertNumQueries(35):
136136
unit = self.create_unit_with_components([self.component_1, self.component_2_v1])
137-
with self.assertNumQueries(48): # TODO: this seems high?
137+
with self.assertNumQueries(49): # TODO: this seems high?
138138
content_api.publish_from_drafts(
139139
self.learning_package.id,
140140
draft_qset=content_api.get_all_drafts(self.learning_package.id).filter(entity=unit.id),

0 commit comments

Comments
 (0)