Skip to content

Commit

Permalink
Set icon and logo to None
Browse files Browse the repository at this point in the history
  • Loading branch information
arnav13081994 committed Mar 21, 2023
1 parent b5e4295 commit 55715d9
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/test_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,8 @@ def test__attach_objects_post_save_hook(
"""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
assert account_instance.branding_icon is None
assert account_instance.branding_logo is None

with patch("djstripe.models.core.File") as mock_file:
with patch.object(mock_file.return_value, "api_retrieve") as mock_retrieve:
Expand Down Expand Up @@ -638,8 +638,8 @@ def test__attach_objects_post_save_hook_invalid_permission_error(
"""Ensure _attach_objects_post_save_hook() on Account model raises Error 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
assert account_instance.branding_icon is None
assert account_instance.branding_logo is None

with patch("djstripe.models.account.logger") as mock_logger:
with patch("djstripe.models.core.File") as mock_file:
Expand Down Expand Up @@ -676,8 +676,8 @@ def test__attach_objects_post_save_hook_invalid_invalid_request_error_unknown_ex
"""Ensure _attach_objects_post_save_hook() on Account model raises Error 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
assert account_instance.branding_icon is None
assert account_instance.branding_logo is None

with pytest.raises(stripe.error.InvalidRequestError) as exc:
with patch("djstripe.models.core.File") as mock_file:
Expand Down Expand Up @@ -705,8 +705,8 @@ def test__attach_objects_post_save_hook_invalid_invalid_request_error_known_exce
"""Ensure _attach_objects_post_save_hook() on Account model raises Error 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
assert account_instance.branding_icon is None
assert account_instance.branding_logo is None

# No exception is raised
with patch("djstripe.models.core.File") as mock_file:
Expand All @@ -732,8 +732,8 @@ def test__attach_objects_post_save_hook_invalid_authentication_error(
"""Ensure _attach_objects_post_save_hook() on Account model raises Error 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
assert account_instance.branding_icon is None
assert account_instance.branding_logo is None

with patch("djstripe.models.account.logger") as mock_logger:
with patch("djstripe.models.core.File") as mock_file:
Expand Down Expand Up @@ -872,12 +872,12 @@ def test_business_url(
def test_branding_logo(self, platform_account_fixture):
"""Ensure Account model's branding_logo property works as expected."""
account = platform_account_fixture[1]
assert account.branding_logo.id == "file_1J423CJSZQVUcJYg7AsfwjcQ"
assert account.branding_logo is None

def test_branding_icon(self, platform_account_fixture):
"""Ensure Account model's branding_icon property works as expected."""
account = platform_account_fixture[1]
assert account.branding_icon.id == "file_1J422OJSZQVUcJYgLYKEC9w6"
assert account.branding_icon is None

@pytest.mark.parametrize(
"business_profile_update, settings_dashboard_update, expected_account_str",
Expand Down

0 comments on commit 55715d9

Please sign in to comment.