def test__attach_objects_post_save_hook(
        self, account, request, platform_account_fixture, configure_settings
    ):
        """Ensure _attach_objects_post_save_hook() on Account model works as expected."""
        account_json, account_instance = request.getfixturevalue(account)

        assert account_instance.branding_icon is not None
        assert account_instance.branding_logo is not None

        with patch("djstripe.models.core.File") as mock_file:
            with patch.object(mock_file.return_value, "api_retrieve") as mock_retrieve:
                # Invoke _attach_objects_post_save_hook()
                account_instance._attach_objects_post_save_hook(
                    cls=Account, data=account_json, api_key=settings.STRIPE_SECRET_KEY
                )

        # one for Icon and one for Logo
        mock_retrieve.assert_has_calls(
            [
                call(
                    stripe_account=account_instance.id,
                    api_key=settings.STRIPE_TEST_SECRET_KEY,
                ),
                call(
                    stripe_account=account_instance.id,
                    api_key=settings.STRIPE_TEST_SECRET_KEY,
                ),
            ]
        )
Ensure _attach_objects_post_save_hook() on Account model works as expected.
tests/test_account.py