3
0
Fork 0

test: add test for make_json_safe() with uuid value

whoops, missed that..
This commit is contained in:
Lance Edgar 2024-12-10 12:15:00 -06:00
parent 40562c126e
commit ddec30905e

View file

@ -1,6 +1,7 @@
# -*- coding: utf-8; -*-
import json
import uuid as _uuid
from unittest import TestCase
from unittest.mock import patch, MagicMock
@ -564,6 +565,11 @@ class TestMakeJsonSafe(TestCase):
value = mod.make_json_safe(person, key='person')
self.assertEqual(value, "Betty Boop")
def test_uuid(self):
uuid = _uuid.uuid4()
value = mod.make_json_safe(uuid)
self.assertEqual(value, uuid.hex)
def test_dict(self):
model = self.app.model
person = model.Person(full_name="Betty Boop")