Files
superset2/tests/unit_tests/models
Mike Bridge 9c9cb3a5f0 test(models): lock in UUIDMixin._coerce_uuid contract (S3)
Four unit tests pin the behavior the validator added in 46f138326b:

* Valid UUID-format strings get coerced to ``uuid.UUID`` instances —
  the primary contract that makes importers, test fixtures, and ad-hoc
  ``Model(uuid=...)`` construction see a consistent type.
* Already-``UUID`` values pass through unchanged (the validator must
  not re-wrap; ``is`` identity check pins this).
* Non-UUID-shaped strings pass through unchanged. This keeps test
  mocks that use placeholder strings (e.g.
  ``tests/unit_tests/mcp_service/dashboard/test_dashboard_schemas.py::test_dashboard_schema``
  with ``"dashboard-uuid-7"``) working. Without this contract, those
  tests would break under the validator and need to migrate to
  ``uuid.uuid4()``. If the contract is ever tightened to raise, this
  test catches the regression and signals the migration cost.
* ``None`` passes through unchanged.

Closes review item S3 from the sqlalchemy-review pass on
sc-103156-versioning.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 15:37:20 -06:00
..
2022-08-08 12:07:16 -07:00