def test_bind_uuid_not_uuid_type(self, uuid: UUID) -> None:
"""
Tests that if the parameter to write in is a string that looks like
a UUID, then it is written to the DB as a de-hyphenated UUID. This
means that the id ``7490bda6-7c69-47c2-ad97-c7453f15811c`` gets written
as ``7490bda67c6947c2ad97c7453f15811c``. The length of the
de-hyphenated UUID MUST be 32 characters.
:param uuid: The uuid to write, randomly generated
"""
db_uuid = DB_UUID()
value_to_store = db_uuid.process_bind_param(
str(uuid), self.sqlite_dialect
)
self.assertEqual(
value_to_store, value_to_store.replace('-', '')
)
self.assertEqual(
self.expected_de_hyphenated_uuid_length,
len(value_to_store)
)
评论列表
文章目录