Skip to content

Commit 8ba850e

Browse files
committed
style: Simplify code in tests
1 parent 1367939 commit 8ba850e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

openedx/core/djangoapps/content_libraries/tests/test_containers.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,11 +1074,12 @@ def test_container_draft_history_includes_descendant_components(self):
10741074
history = self._get_container_draft_history(unit["id"])
10751075
changed_at_list = [entry["changed_at"] for entry in history]
10761076
# Both the container edit and the block edit should appear in the history.
1077-
assert block_edit_time.isoformat().replace("+00:00", "Z") in changed_at_list
1078-
assert container_edit_time.isoformat().replace("+00:00", "Z") in changed_at_list
1077+
block_edit_time_str = block_edit_time.isoformat().replace("+00:00", "Z")
1078+
container_edit_time_str = container_edit_time.isoformat().replace("+00:00", "Z")
1079+
assert block_edit_time_str in changed_at_list
1080+
assert container_edit_time_str in changed_at_list
10791081
# History is sorted newest-first, so the block edit should come before the container edit.
1080-
assert changed_at_list.index(block_edit_time.isoformat().replace("+00:00", "Z")) < \
1081-
changed_at_list.index(container_edit_time.isoformat().replace("+00:00", "Z"))
1082+
assert changed_at_list.index(block_edit_time_str) < changed_at_list.index(container_edit_time_str)
10821083

10831084
def test_container_draft_history_action_renamed(self):
10841085
"""

0 commit comments

Comments
 (0)