diff --git a/api/tests/unit/sales_dashboard/test_unit_sales_dashboard_views.py b/api/tests/unit/sales_dashboard/test_unit_sales_dashboard_views.py index 1ab1dc97fcf08..badd6db06937b 100644 --- a/api/tests/unit/sales_dashboard/test_unit_sales_dashboard_views.py +++ b/api/tests/unit/sales_dashboard/test_unit_sales_dashboard_views.py @@ -70,18 +70,16 @@ def test_get_organisation_info__get_event_list_for_organisation( def test_list_organisations_search_by_name( organisation: Organisation, - client: Client, - admin_user: FFAdminUser, + superuser_client: Client, ) -> None: # Given # use the truncated organisation name to ensure fuzzy search works search_term = organisation.name[1:-1] url = "%s?search=%s" % (reverse("sales_dashboard:index"), search_term) - client.force_login(admin_user) # When - response = client.get(url) + response = superuser_client.get(url) # Then assert response.status_code == 200 @@ -92,17 +90,15 @@ def test_list_organisations_search_by_name( def test_list_organisations_search_by_subscription_id( organisation: Organisation, chargebee_subscription: Subscription, - client: Client, - admin_user: FFAdminUser, + superuser_client: Client, ) -> None: # Given search_term = chargebee_subscription.subscription_id url = "%s?search=%s" % (reverse("sales_dashboard:index"), search_term) - client.force_login(admin_user) # When - response = client.get(url) + response = superuser_client.get(url) # Then assert response.status_code == 200 @@ -111,17 +107,16 @@ def test_list_organisations_search_by_subscription_id( def test_list_organisations_search_by_user_email( organisation: Organisation, - client: Client, + superuser_client: Client, admin_user: FFAdminUser, ) -> None: # Given search_term = admin_user.email url = "%s?search=%s" % (reverse("sales_dashboard:index"), search_term) - client.force_login(admin_user) # When - response = client.get(url) + response = superuser_client.get(url) # Then assert response.status_code == 200 @@ -131,18 +126,16 @@ def test_list_organisations_search_by_user_email( def test_list_organisations_filter_plan( organisation: Organisation, chargebee_subscription: Subscription, - client: Client, - admin_user: FFAdminUser, + superuser_client: Client, ) -> None: # Given url = "%s?filter_plan=%s" % ( reverse("sales_dashboard:index"), chargebee_subscription.plan, ) - client.force_login(admin_user) # When - response = client.get(url) + response = superuser_client.get(url) # Then assert response.status_code == 200