Hello community,

here is the log from the commit of package python-Django1 for openSUSE:Factory 
checked in at 2020-01-16 18:16:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-Django1 (Old)
 and      /work/SRC/openSUSE:Factory/.python-Django1.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-Django1"

Thu Jan 16 18:16:53 2020 rev:19 rq:764709 version:1.11.27

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-Django1/python-Django1.changes    
2019-12-30 12:34:12.983784733 +0100
+++ /work/SRC/openSUSE:Factory/.python-Django1.new.26092/python-Django1.changes 
2020-01-16 18:16:57.056829216 +0100
@@ -1,0 +2,5 @@
+Wed Jan 15 14:55:09 UTC 2020 - Ondřej Súkup <[email protected]>
+
+- add pyyaml53.patch - fix tests with new PyYAML 5.3
+
+-------------------------------------------------------------------

New:
----
  pyyaml53.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-Django1.spec ++++++
--- /var/tmp/diff_new_pack.DIUV1w/_old  2020-01-16 18:16:58.804830204 +0100
+++ /var/tmp/diff_new_pack.DIUV1w/_new  2020-01-16 18:16:58.804830204 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-Django1
 #
-# Copyright (c) 2019 SUSE LLC
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -35,6 +35,7 @@
 Patch0:         django-sqlite-326.patch
 # PATCH-FIX-OPENSUSE bmwiedemann -- fix tests after 2028 - merged in Django 
master only
 Patch2:         fix2028.patch
+Patch3:         pyyaml53.patch
 BuildRequires:  %{python_module Jinja2 >= 2.9.2}
 BuildRequires:  %{python_module Pillow}
 BuildRequires:  %{python_module PyYAML}
@@ -93,6 +94,7 @@
 %setup -q -n Django-%{version}
 %patch0 -p1
 %patch2 -p1
+%patch3 -p1
 
 %build
 %python_build


++++++ pyyaml53.patch ++++++
>From 4a6824e450e15aeb3558ba80b1b314e33a6e7b0b Mon Sep 17 00:00:00 2001
From: Mariusz Felisiak <[email protected]>
Date: Tue, 7 Jan 2020 08:59:22 +0100
Subject: [PATCH] Fixed timezones tests for PyYAML 5.3+.

---
 tests/timezones/tests.py | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

Index: Django-1.11.27/tests/timezones/tests.py
===================================================================
--- Django-1.11.27.orig/tests/timezones/tests.py
+++ Django-1.11.27/tests/timezones/tests.py
@@ -36,6 +36,12 @@ from .models import (
     AllDayEvent, Event, MaybeEvent, Session, SessionEvent, Timestamp,
 )
 
+try:
+    import yaml
+    HAS_YAML = True
+except ImportError:
+    HAS_YAML = False
+
 # These tests use the EAT (Eastern Africa Time) and ICT (Indochina Time)
 # who don't have Daylight Saving Time, so we can represent them easily
 # with FixedOffset, and use them directly as tzinfo in the constructors.
@@ -662,9 +668,10 @@ class SerializationTests(SimpleTestCase)
 
     # Backend-specific notes:
     # - JSON supports only milliseconds, microseconds will be truncated.
-    # - PyYAML dumps the UTC offset correctly for timezone-aware datetimes,
-    #   but when it loads this representation, it subtracts the offset and
-    #   returns a naive datetime object in UTC. See ticket #18867.
+    # - PyYAML dumps the UTC offset correctly for timezone-aware datetimes.
+    #   When PyYAML < 5.3 loads this representation, it subtracts the offset
+    #   and returns a naive datetime object in UTC. PyYAML 5.3+ loads timezones
+    #   correctly.
     # Tests are adapted to take these quirks into account.
 
     def assert_python_contains_datetime(self, objects, dt):
@@ -751,7 +758,10 @@ class SerializationTests(SimpleTestCase)
             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)
+            if HAS_YAML and yaml.__version__ < '5.3':
+                self.assertEqual(obj.dt.replace(tzinfo=UTC), dt)
+            else:
+                self.assertEqual(obj.dt, dt)
 
     def test_aware_datetime_in_utc(self):
         dt = datetime.datetime(2011, 9, 1, 10, 20, 30, tzinfo=UTC)
@@ -799,7 +809,10 @@ class SerializationTests(SimpleTestCase)
             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)
+            if HAS_YAML and yaml.__version__ < '5.3':
+                self.assertEqual(obj.dt.replace(tzinfo=UTC), dt)
+            else:
+                self.assertEqual(obj.dt, dt)
 
     def test_aware_datetime_in_other_timezone(self):
         dt = datetime.datetime(2011, 9, 1, 17, 20, 30, tzinfo=ICT)
@@ -823,7 +836,10 @@ class SerializationTests(SimpleTestCase)
             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)
+            if HAS_YAML and yaml.__version__ < '5.3':
+                self.assertEqual(obj.dt.replace(tzinfo=UTC), dt)
+            else:
+                self.assertEqual(obj.dt, dt)
 
 
 @override_settings(DATETIME_FORMAT='c', TIME_ZONE='Africa/Nairobi', 
USE_L10N=False, USE_TZ=True)

Reply via email to