Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Updated tests and changelog for disabling/enabling playground

Mikail KOCAKefbebcc10aa2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3c96b42394..33c0af0efb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -64,7 +64,8 @@ All notable, unreleased changes to this project will be documented in this file.
- Add slug to Warehouse, Product, ProductType and update slug in models which already using it - #5196 by @IKarbowiak
- Add mutation for assigning, unassigning shipping zones to warehouse - #5217 by @kswiatek92
- Fix passing addresses to `PaymentData` objects - #5223 by @maarcingebala
-- Return `null` when querying `me` as an anonymous user - #5231 as @maarcingebala
+- Return `null` when querying `me` as an anonymous user - #5231 by @maarcingebala
+- Added `PLAYGROUND_ENABLED` environment variable/setting to allow to enable the GraphQL playground when `DEBUG` is disabled - #5254 by @NyanKiyoshi
## 2.9.0
diff --git a/tests/api/test_view.py b/tests/api/test_view.py
index ae7f070653..7d80c329da 100644
--- a/tests/api/test_view.py
+++ b/tests/api/test_view.py
@@ -52,16 +52,14 @@ def test_batch_queries(category, product, api_client):
assert data["category"]["name"] == category.name
-def test_graphql_view_get_in_non_debug_mode(client):
+def test_graphql_view_get_enabled_or_disabled(client, settings):
+ settings.PLAYGROUND_ENABLED = False
response = client.get(API_PATH)
assert response.status_code == 405
-
-@override_settings(DEBUG=True)
-def test_graphql_view_get_in_debug_mode(client):
+ settings.PLAYGROUND_ENABLED = True
response = client.get(API_PATH)
assert response.status_code == 200
- assert response.templates[0].name == "graphql/playground.html"
def test_graphql_view_options(client):