def test_get_stripe_dashboard_url(
        self, account, livemode, request, platform_account_fixture, configure_settings
    ):
        """Ensure get_stripe_dashboard_url() on Account model works as expected."""
        # second entry is the model instance
        djstripe_account = request.getfixturevalue(account)[1]
        # Platform accounts do not have a livemode
        if account != "platform_account_fixture":
            djstripe_account.livemode = livemode
            djstripe_account.save()
            djstripe_account.refresh_from_db()

        assert (
            djstripe_account.get_stripe_dashboard_url()
            == f"https://dashboard.stripe.com/{djstripe_account.id}/"
            f"{'test/' if not djstripe_account.livemode else ''}dashboard"
        )
Ensure get_stripe_dashboard_url() on Account model works as expected.
tests/test_account.py