This commit is contained in:
Kenneth Kehl
2025-09-15 10:13:49 -07:00
parent 602fb7c881
commit fed0af116b
+10 -9
View File
@@ -1,9 +1,7 @@
import json
import uuid import uuid
from unittest.mock import Mock from unittest.mock import Mock
import pytest import pytest
from flask import current_app
from freezegun import freeze_time from freezegun import freeze_time
from hypothesis import given from hypothesis import given
from hypothesis import strategies as st from hypothesis import strategies as st
@@ -266,16 +264,19 @@ def test_fuzz_create_org_with_edge_cases(
"active": active, "active": active,
"organization_type": org_type_serialized, "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: is_valid = {
json.dumps(data) isinstance(name, str)
except TypeError as e: and name.strip() != ""
pytest.fail(f"Test generated non-serializable data: {data} {e}") and isinstance(organization_type, OrganizationType)
and isinstance(active, bool)
}
expected_status = 201 if is_valid else 400
try: try:
response = admin_request.post( response = admin_request.post(
"organization.create_organization", _data=data, _expected_status=None "organization.create_organization",
_data=data,
_expected_status=expected_status,
) )
if ( if (
name name