summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorChoi Geonu <Hardtack@users.noreply.github.com>2021-03-01 22:42:42 +0900
committerGitHub <noreply@github.com>2021-03-01 14:42:42 +0100
commit3e5263c481cc2523cdb9aa013bf0643657433162 (patch)
tree139f889f3258feaa1a54986bd453a4ee9fdd0854 /t
parentae9ce769c3a51d19f101f83b6fbcb8087388bc43 (diff)
downloadkombu-3e5263c481cc2523cdb9aa013bf0643657433162.tar.gz
Disable namedtuple to object feature in simplejson (#1297)
Diffstat (limited to 't')
-rw-r--r--t/unit/utils/test_json.py5
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)}