summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorvinay karanam <vinayinvicible@users.noreply.github.com>2017-05-23 07:28:38 +0530
committerTim Graham <timograham@gmail.com>2017-05-22 21:58:38 -0400
commitd1d08d86baef05db5b37c266ed9142f1c57e6322 (patch)
tree11ead375d41838df0f83f3a97843ea72cad5d9a8 /tests
parent65dfe579d08361e04b7b3c1895b10f84b69d5c59 (diff)
[1.11.x] Fixed #28230 -- Allowed DjangoJsonEncoder to serialize CallableBool.
Diffstat (limited to 'tests')
-rw-r--r--tests/serializers/test_json.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/serializers/test_json.py b/tests/serializers/test_json.py
index b191ce6644..391523ae33 100644
--- a/tests/serializers/test_json.py
+++ b/tests/serializers/test_json.py
@@ -12,6 +12,7 @@ from django.core.serializers.json import DjangoJSONEncoder
from django.db import models
from django.test import SimpleTestCase, TestCase, TransactionTestCase
from django.test.utils import isolate_apps
+from django.utils.deprecation import CallableFalse, CallableTrue
from django.utils.translation import override, ugettext_lazy
from .models import Score
@@ -315,3 +316,7 @@ class DjangoJSONEncoderTests(SimpleTestCase):
json.dumps({'duration': duration}, cls=DjangoJSONEncoder),
'{"duration": "P0DT00H00M00S"}'
)
+
+ def test_callable_bool(self):
+ self.assertEqual(json.dumps(CallableTrue, cls=DjangoJSONEncoder), 'true')
+ self.assertEqual(json.dumps(CallableFalse, cls=DjangoJSONEncoder), 'false')