File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22from collections import OrderedDict
33from decimal import Decimal
44
5- import django
65from django .core .serializers import deserialize , serialize
76from django .core .serializers .base import DeserializationError
87from django .forms import ValidationError
@@ -195,12 +194,7 @@ def test_invalid_json(self):
195194 '"fields": {"json": "{]", "default_json": "{]"}}]'
196195 with self .assertRaises (DeserializationError ) as cm :
197196 next (deserialize ('json' , ser ))
198- # Django 2 does not reraise DeserializationError as another DeserializationError
199- # Changed in: https://github.com/django/django/pull/7878
200- if django .VERSION < (2 , 0 ,):
201- inner = cm .exception .__context__ .__context__
202- else :
203- inner = cm .exception .__context__
197+ inner = cm .exception .__context__
204198 self .assertIsInstance (inner , ValidationError )
205199 self .assertEqual ('Enter valid JSON.' , inner .messages [0 ])
206200
You can’t perform that action at this time.
0 commit comments