Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-djangorestframework-simplejwt
for openSUSE:Factory checked in at 2024-07-22 17:15:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-djangorestframework-simplejwt (Old)
and
/work/SRC/openSUSE:Factory/.python-djangorestframework-simplejwt.new.17339 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-djangorestframework-simplejwt"
Mon Jul 22 17:15:54 2024 rev:7 rq:1188599 version:5.3.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-djangorestframework-simplejwt/python-djangorestframework-simplejwt.changes
2024-06-25 23:08:44.065054856 +0200
+++
/work/SRC/openSUSE:Factory/.python-djangorestframework-simplejwt.new.17339/python-djangorestframework-simplejwt.changes
2024-07-22 17:16:23.961436803 +0200
@@ -1,0 +2,5 @@
+Fri Jul 19 11:26:13 UTC 2024 - Markéta Machová <[email protected]>
+
+- Add upstream patch fix-tests.patch to fix tests with Django 5
+
+-------------------------------------------------------------------
New:
----
fix-tests.patch
BETA DEBUG BEGIN:
New:
- Add upstream patch fix-tests.patch to fix tests with Django 5
BETA DEBUG END:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-djangorestframework-simplejwt.spec ++++++
--- /var/tmp/diff_new_pack.ReeNrd/_old 2024-07-22 17:16:24.505458693 +0200
+++ /var/tmp/diff_new_pack.ReeNrd/_new 2024-07-22 17:16:24.505458693 +0200
@@ -24,6 +24,8 @@
License: MIT
URL: https://github.com/davesque/django-rest-framework-simplejwt
Source:
https://files.pythonhosted.org/packages/source/d/djangorestframework-simplejwt/djangorestframework_simplejwt-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM
https://github.com/jazzband/djangorestframework-simplejwt/pull/769 Fix tests
+Patch0: fix-tests.patch
BuildRequires: %{python_module Django}
BuildRequires: %{python_module PyJWT}
BuildRequires: %{python_module djangorestframework}
++++++ fix-tests.patch ++++++
>From 0b50ee6721155ce0f652d4c1f47dcbb10c191894 Mon Sep 17 00:00:00 2001
From: Mike <[email protected]>
Date: Mon, 4 Dec 2023 17:48:36 -0800
Subject: [PATCH] Fix tests (#769)
---
rest_framework_simplejwt/utils.py | 5 ++---
tests/test_init.py | 5 ++---
tests/test_utils.py | 11 ++++-------
3 files changed, 8 insertions(+), 13 deletions(-)
Index: djangorestframework_simplejwt-5.3.1/rest_framework_simplejwt/utils.py
===================================================================
--- djangorestframework_simplejwt-5.3.1.orig/rest_framework_simplejwt/utils.py
+++ djangorestframework_simplejwt-5.3.1/rest_framework_simplejwt/utils.py
@@ -5,7 +5,6 @@ from typing import Callable
from django.conf import settings
from django.utils.functional import lazy
-from django.utils.timezone import is_naive, make_aware
def get_md5_hash_password(password: str) -> str:
@@ -16,8 +15,8 @@ def get_md5_hash_password(password: str)
def make_utc(dt: datetime) -> datetime:
- if settings.USE_TZ and is_naive(dt):
- return make_aware(dt, timezone=timezone.utc)
+ if settings.USE_TZ and dt.tzinfo is None:
+ return dt.replace(tzinfo=timezone.utc)
return dt
Index: djangorestframework_simplejwt-5.3.1/tests/test_utils.py
===================================================================
--- djangorestframework_simplejwt-5.3.1.orig/tests/test_utils.py
+++ djangorestframework_simplejwt-5.3.1/tests/test_utils.py
@@ -1,7 +1,6 @@
-from datetime import datetime, timedelta
+from datetime import datetime, timedelta, timezone
from django.test import TestCase
-from django.utils import timezone
from freezegun import freeze_time
from rest_framework_simplejwt.utils import (
@@ -24,11 +23,11 @@ class TestMakeUtc(TestCase):
with self.settings(USE_TZ=False):
dt = make_utc(dt)
- self.assertTrue(timezone.is_naive(dt))
+ self.assertTrue(dt.tzinfo is None)
with self.settings(USE_TZ=True):
dt = make_utc(dt)
- self.assertTrue(timezone.is_aware(dt))
+ self.assertTrue(dt.tzinfo is not None)
self.assertEqual(dt.utcoffset(), timedelta(seconds=0))
@@ -39,9 +38,7 @@ class TestAwareUtcnow(TestCase):
with freeze_time(now):
# Should return aware utcnow if USE_TZ == True
with self.settings(USE_TZ=True):
- self.assertEqual(
- timezone.make_aware(now, timezone=timezone.utc),
aware_utcnow()
- )
+ self.assertEqual(now.replace(tzinfo=timezone.utc),
aware_utcnow())
# Should return naive utcnow if USE_TZ == False
with self.settings(USE_TZ=False):