summaryrefslogtreecommitdiff
path: root/tests/timezones
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2019-03-13 20:06:47 +0100
committerTim Graham <timograham@gmail.com>2019-03-14 13:16:48 -0400
commita57c783dd4e6dc73847081221827a1902eede88b (patch)
treefe4f348b238e7726b82036f0b535ba0ffc2122ac /tests/timezones
parent782d85b6dfa191e67c0f1d572641d8236c79174c (diff)
downloaddjango-a57c783dd4e6dc73847081221827a1902eede88b.tar.gz
Fixed serializers tests for PyYAML 5.1+.
Diffstat (limited to 'tests/timezones')
-rw-r--r--tests/timezones/tests.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/timezones/tests.py b/tests/timezones/tests.py
index e54b011c04..7a63bac670 100644
--- a/tests/timezones/tests.py
+++ b/tests/timezones/tests.py
@@ -643,7 +643,7 @@ class SerializationTests(SimpleTestCase):
self.assertEqual(obj.dt, dt)
if not isinstance(serializers.get_serializer('yaml'), serializers.BadSerializer):
- data = serializers.serialize('yaml', [Event(dt=dt)])
+ data = serializers.serialize('yaml', [Event(dt=dt)], default_flow_style=None)
self.assert_yaml_contains_datetime(data, "2011-09-01 13:20:30")
obj = next(serializers.deserialize('yaml', data)).object
self.assertEqual(obj.dt, dt)
@@ -667,7 +667,7 @@ class SerializationTests(SimpleTestCase):
self.assertEqual(obj.dt, dt)
if not isinstance(serializers.get_serializer('yaml'), serializers.BadSerializer):
- data = serializers.serialize('yaml', [Event(dt=dt)])
+ data = serializers.serialize('yaml', [Event(dt=dt)], default_flow_style=None)
self.assert_yaml_contains_datetime(data, "2011-09-01 13:20:30.405060")
obj = next(serializers.deserialize('yaml', data)).object
self.assertEqual(obj.dt, dt)
@@ -691,7 +691,7 @@ class SerializationTests(SimpleTestCase):
self.assertEqual(obj.dt, dt)
if not isinstance(serializers.get_serializer('yaml'), serializers.BadSerializer):
- data = serializers.serialize('yaml', [Event(dt=dt)])
+ data = serializers.serialize('yaml', [Event(dt=dt)], default_flow_style=None)
self.assert_yaml_contains_datetime(data, "2011-09-01 17:20:30.405060+07:00")
obj = next(serializers.deserialize('yaml', data)).object
self.assertEqual(obj.dt.replace(tzinfo=UTC), dt)
@@ -715,7 +715,7 @@ class SerializationTests(SimpleTestCase):
self.assertEqual(obj.dt, dt)
if not isinstance(serializers.get_serializer('yaml'), serializers.BadSerializer):
- data = serializers.serialize('yaml', [Event(dt=dt)])
+ data = serializers.serialize('yaml', [Event(dt=dt)], default_flow_style=None)
self.assert_yaml_contains_datetime(data, "2011-09-01 10:20:30+00:00")
obj = next(serializers.deserialize('yaml', data)).object
self.assertEqual(obj.dt.replace(tzinfo=UTC), dt)
@@ -739,7 +739,7 @@ class SerializationTests(SimpleTestCase):
self.assertEqual(obj.dt, dt)
if not isinstance(serializers.get_serializer('yaml'), serializers.BadSerializer):
- data = serializers.serialize('yaml', [Event(dt=dt)])
+ data = serializers.serialize('yaml', [Event(dt=dt)], default_flow_style=None)
self.assert_yaml_contains_datetime(data, "2011-09-01 13:20:30+03:00")
obj = next(serializers.deserialize('yaml', data)).object
self.assertEqual(obj.dt.replace(tzinfo=UTC), dt)
@@ -763,7 +763,7 @@ class SerializationTests(SimpleTestCase):
self.assertEqual(obj.dt, dt)
if not isinstance(serializers.get_serializer('yaml'), serializers.BadSerializer):
- data = serializers.serialize('yaml', [Event(dt=dt)])
+ data = serializers.serialize('yaml', [Event(dt=dt)], default_flow_style=None)
self.assert_yaml_contains_datetime(data, "2011-09-01 17:20:30+07:00")
obj = next(serializers.deserialize('yaml', data)).object
self.assertEqual(obj.dt.replace(tzinfo=UTC), dt)