Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Jan 21, 2025
1 parent 0a2547d commit 83b4d8c
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions api/tacticalrmm/ee/reporting/tests/test_dataquery_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ def test_unauthenticated_delete_html_template_view(

@pytest.mark.django_db
class TestQuerySchema:
def test_get_query_schema_in_debug_mode(self, settings, authenticated_client):
# Set DEBUG mode
settings.DEBUG = True
def test_get_query_schema(self, settings, authenticated_client):

expected_data = {"sample": "json"}

Expand All @@ -166,19 +164,6 @@ def test_get_query_schema_in_debug_mode(self, settings, authenticated_client):
assert response.status_code == status.HTTP_200_OK
assert response.json() == expected_data

def test_get_query_schema_in_production_mode(self, settings, authenticated_client):
# Set production mode (DEBUG = False)
settings.DEBUG = False

response = authenticated_client.get("/reporting/queryschema/")

assert response.status_code == status.HTTP_200_OK
# Check that the X-Accel-Redirect header is set correctly
assert (
response["X-Accel-Redirect"]
== "/static/reporting/schemas/query_schema.json"
)

def test_get_query_schema_file_missing(self, settings, authenticated_client):
# Set DEBUG mode
settings.DEBUG = True
Expand Down

0 comments on commit 83b4d8c

Please sign in to comment.