Skip to content

Commit

Permalink
Merge branch 'refactor-catalogue-item-repo-unit-tests-#340' into refa…
Browse files Browse the repository at this point in the history
…ctor-catalogue-item-e2e-tests-#342
  • Loading branch information
joelvdavies committed Sep 3, 2024
2 parents 5512b26 + a605b51 commit bad652b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/unit/services/test_catalogue_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,6 @@ def mock_update(
)

# When properties are given need to add any property `id`s and ensure the expected data inserts them as well
property_post_schemas = []
expected_properties_in = []
if self._updating_properties:

Expand Down Expand Up @@ -758,8 +757,9 @@ def check_update_success(self) -> None:
)

# Ensure obtained new catalogue category if moving
expected_catalogue_category_get_calls = []
if self._moving_catalogue_item and self._catalogue_item_patch.catalogue_category_id:
expected_catalogue_category_get_calls = [call(self._catalogue_item_patch.catalogue_category_id)]
expected_catalogue_category_get_calls.append(call(self._catalogue_item_patch.catalogue_category_id))

# Expect additional call from existing catalogue category to compare properties if new properties aren't
# given
Expand Down Expand Up @@ -809,8 +809,8 @@ class TestUpdate(UpdateDSL):
"""Tests for updating a catalogue item."""

def test_update_all_fields_except_ids_or_properties_with_no_children(self):
"""Test updating all fields of a catalogue item except its any of its `_id` fields or properties when it has
no children."""
"""Test updating all fields of a catalogue item except any of its `_id` fields or properties when it has no
children."""

catalogue_item_id = str(ObjectId())

Expand All @@ -823,8 +823,7 @@ def test_update_all_fields_except_ids_or_properties_with_no_children(self):
self.check_update_success()

def test_update_all_fields_except_ids_or_properties_with_children(self):
"""Test updating all fields of a catalogue item except its any of its `_id` fields or properties it has
children."""
"""Test updating all fields of a catalogue item except any of its `_id` fields or properties it has children."""

catalogue_item_id = str(ObjectId())

Expand Down

0 comments on commit bad652b

Please sign in to comment.