diff options
author | Choi Geonu <Hardtack@users.noreply.github.com> | 2021-03-01 22:42:42 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-01 14:42:42 +0100 |
commit | 3e5263c481cc2523cdb9aa013bf0643657433162 (patch) | |
tree | 139f889f3258feaa1a54986bd453a4ee9fdd0854 /t | |
parent | ae9ce769c3a51d19f101f83b6fbcb8087388bc43 (diff) | |
download | kombu-3e5263c481cc2523cdb9aa013bf0643657433162.tar.gz |
Disable namedtuple to object feature in simplejson (#1297)
Diffstat (limited to 't')
-rw-r--r-- | t/unit/utils/test_json.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/t/unit/utils/test_json.py b/t/unit/utils/test_json.py index 372ba517..e3a8fa11 100644 --- a/t/unit/utils/test_json.py +++ b/t/unit/utils/test_json.py @@ -1,6 +1,7 @@ import pytest import pytz +from collections import namedtuple from datetime import datetime from decimal import Decimal from uuid import uuid4 @@ -43,6 +44,10 @@ class test_JSONEncoder: d = Decimal('3314132.13363235235324234123213213214134') assert loads(dumps({'d': d})), {'d': str(d)} + def test_namedtuple(self): + Foo = namedtuple('Foo', ['bar']) + assert loads(dumps(Foo(123))) == [123] + def test_UUID(self): id = uuid4() assert loads(dumps({'u': id})), {'u': str(id)} |