This commit is contained in:
Kenneth Kehl
2025-09-15 10:13:49 -07:00
parent 602fb7c881
commit fed0af116b

View File

@@ -1,9 +1,7 @@
import json
import uuid
from unittest.mock import Mock
import pytest
from flask import current_app
from freezegun import freeze_time
from hypothesis import given
from hypothesis import strategies as st
@@ -266,16 +264,19 @@ def test_fuzz_create_org_with_edge_cases(
"active": active,
"organization_type": org_type_serialized,
}
current_app.logger.info(f"DATA IS A {type(data)}")
current_app.logger.info(f"ORG TYPE IS A {type(org_type_serialized)}")
try:
json.dumps(data)
except TypeError as e:
pytest.fail(f"Test generated non-serializable data: {data} {e}")
is_valid = {
isinstance(name, str)
and name.strip() != ""
and isinstance(organization_type, OrganizationType)
and isinstance(active, bool)
}
expected_status = 201 if is_valid else 400
try:
response = admin_request.post(
"organization.create_organization", _data=data, _expected_status=None
"organization.create_organization",
_data=data,
_expected_status=expected_status,
)
if (
name