Skip to content

Commit

Permalink
Remove unnecessary 'mock_stale_objects' attr and description
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Babic committed Feb 25, 2024
1 parent 114f8df commit 746fbaf
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tests/test_management_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ def setUp(self) -> None:
# Patch save() to prevent unnecessary database writes
self.patched_obj.save = mock.Mock()

# Create an iterable containing the patched object
# To be returned by a patched get_stale_objects() method
self.mock_stale_objects = (self.patched_obj,)

def call_command(self, *args, **kwargs):
"""
Calls the command with the provided arguments, whilst also also mocking
Expand All @@ -91,7 +87,7 @@ def call_command(self, *args, **kwargs):
),
mock.patch(
"wagtail_bynder.management.commands.base.BaseBynderSyncCommand.get_stale_objects",
return_value=self.mock_stale_objects,
return_value=(self.patched_obj,),
),
):
call_command(
Expand Down

0 comments on commit 746fbaf

Please sign in to comment.