Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-django-oscar for 
openSUSE:Factory checked in at 2022-11-04 22:00:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-django-oscar (Old)
 and      /work/SRC/openSUSE:Factory/.python-django-oscar.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-django-oscar"

Fri Nov  4 22:00:04 2022 rev:3 rq:1033573 version:3.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-django-oscar/python-django-oscar.changes  
2022-03-01 17:04:55.644355071 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-django-oscar.new.2275/python-django-oscar.changes
        2022-11-04 22:00:05.692830034 +0100
@@ -1,0 +2,8 @@
+Fri Nov  4 13:05:06 UTC 2022 - Daniel Garcia <[email protected]>
+
+- Add django-41-compat.patch to fix issues with django-4.1
+  gh#django-oscar/django-oscar#3908 
+- Remove python_module macro def
+- More specific python_sitelib in %files
+
+-------------------------------------------------------------------

New:
----
  django-41-compat.patch

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

Other differences:
------------------
++++++ python-django-oscar.spec ++++++
--- /var/tmp/diff_new_pack.y8gySx/_old  2022-11-04 22:00:06.648835077 +0100
+++ /var/tmp/diff_new_pack.y8gySx/_new  2022-11-04 22:00:06.656835119 +0100
@@ -16,7 +16,6 @@
 #
 
 
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 %define skip_python36 1
 Name:           python-django-oscar
@@ -27,6 +26,9 @@
 Group:          Development/Languages/Python
 URL:            https://github.com/django-oscar/django-oscar
 Source:         
https://github.com/django-oscar/django-oscar/archive/%{version}.tar.gz#/django-oscar-%{version}.tar.gz
+# PATCH-FIX-OPENSUSE django-41-compat.patch to fix tests with django-4.1
+# gh#django-oscar/django-oscar#3908
+Patch:          django-41-compat.patch
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
@@ -72,7 +74,7 @@
 A domain-driven e-commerce framework for Django.
 
 %prep
-%setup -q -n django-oscar-%{version}
+%autosetup -p1 -n django-oscar-%{version}
 sed -i "s/,<[0-9.]*'/'/" setup.py
 
 sed -i 's/^import factory/import factory, 
factory.django/;s/factory.DjangoModelFactory/factory.django.DjangoModelFactory/'
 src/oscar/test/factories/*.py
@@ -96,6 +98,7 @@
 %files %{python_files}
 %doc AUTHORS CHANGELOG.rst README.rst
 %license LICENSE
-%{python_sitelib}/*
+%{python_sitelib}/oscar
+%{python_sitelib}/django_oscar-%{version}*-info
 
 %changelog

++++++ django-41-compat.patch ++++++
Index: django-oscar-3.1/src/oscar/apps/basket/middleware.py
===================================================================
--- django-oscar-3.1.orig/src/oscar/apps/basket/middleware.py
+++ django-oscar-3.1/src/oscar/apps/basket/middleware.py
@@ -163,8 +163,8 @@ class BasketMiddleware:
             basket = cookie_basket
         else:
             # Anonymous user with no basket - instantiate a new basket
-            # instance.  No need to save yet.
-            basket = Basket()
+            # instance.
+            basket = Basket.objects.create(status=Basket.OPEN)
 
         # Cache basket instance for the during of this request
         request._basket_cache = basket
Index: django-oscar-3.1/src/oscar/apps/catalogue/product_attributes.py
===================================================================
--- django-oscar-3.1.orig/src/oscar/apps/catalogue/product_attributes.py
+++ django-oscar-3.1/src/oscar/apps/catalogue/product_attributes.py
@@ -20,7 +20,8 @@ class ProductAttributesContainer:
 
     def __init__(self, product):
         self.product = product
-        self.refresh()
+        if self.product.pk:
+            self.refresh()
 
     def refresh(self):
         values = self.get_values().select_related('attribute')
Index: django-oscar-3.1/src/oscar/apps/catalogue/abstract_models.py
===================================================================
--- django-oscar-3.1.orig/src/oscar/apps/catalogue/abstract_models.py
+++ django-oscar-3.1/src/oscar/apps/catalogue/abstract_models.py
@@ -598,7 +598,7 @@ class AbstractProduct(models.Model):
         """
         Test if this product has any stockrecords
         """
-        return self.stockrecords.exists()
+        return self.pk and self.stockrecords.exists()
 
     @property
     def num_stockrecords(self):
Index: django-oscar-3.1/tests/integration/shipping/test_scales.py
===================================================================
--- django-oscar-3.1.orig/tests/integration/shipping/test_scales.py
+++ django-oscar-3.1/tests/integration/shipping/test_scales.py
@@ -27,6 +27,7 @@ class TestScales(TestCase):
 
     def test_returns_zero_for_empty_basket(self):
         basket = Basket()
+        basket.save()
 
         scale = Scale(attribute_code='weight')
         self.assertEqual(0, scale.weigh_basket(basket))
Index: django-oscar-3.1/tests/integration/basket/test_models.py
===================================================================
--- django-oscar-3.1.orig/tests/integration/basket/test_models.py
+++ django-oscar-3.1/tests/integration/basket/test_models.py
@@ -15,6 +15,7 @@ class TestANewBasket(TestCase):
 
     def setUp(self):
         self.basket = Basket()
+        self.basket.save()
         self.basket.strategy = strategy.Default()
 
     def test_has_zero_lines(self):
Index: django-oscar-3.1/tests/integration/shipping/test_method.py
===================================================================
--- django-oscar-3.1.orig/tests/integration/shipping/test_method.py
+++ django-oscar-3.1/tests/integration/shipping/test_method.py
@@ -12,6 +12,7 @@ class TestFreeShipppingForEmptyBasket(Te
     def setUp(self):
         self.method = methods.Free()
         self.basket = Basket()
+        self.basket.save()
         self.charge = self.method.calculate(self.basket)
 
     def test_is_free(self):
@@ -43,6 +44,7 @@ class TestNoShippingRequired(TestCase):
     def setUp(self):
         self.method = methods.NoShippingRequired()
         basket = Basket()
+        basket.save()
         self.charge = self.method.calculate(basket)
 
     def test_is_free_for_empty_basket(self):
@@ -59,6 +61,7 @@ class TestFixedPriceShippingWithoutTax(T
     def setUp(self):
         self.method = methods.FixedPrice(D('10.00'))
         basket = Basket()
+        basket.save()
         self.charge = self.method.calculate(basket)
 
     def test_has_correct_charge(self):
@@ -75,6 +78,7 @@ class TestFixedPriceShippingWithTax(Test
             charge_excl_tax=D('10.00'),
             charge_incl_tax=D('12.00'))
         basket = Basket()
+        basket.save()
         self.charge = self.method.calculate(basket)
 
     def test_has_correct_charge(self):
Index: django-oscar-3.1/src/oscar/apps/customer/apps.py
===================================================================
--- django-oscar-3.1.orig/src/oscar/apps/customer/apps.py
+++ django-oscar-3.1/src/oscar/apps/customer/apps.py
@@ -11,6 +11,7 @@ class CustomerConfig(OscarConfig):
     label = 'customer'
     name = 'oscar.apps.customer'
     verbose_name = _('Customer')
+    default = True
 
     namespace = 'customer'
 
Index: django-oscar-3.1/tests/integration/shipping/test_discount.py
===================================================================
--- django-oscar-3.1.orig/tests/integration/shipping/test_discount.py
+++ django-oscar-3.1/tests/integration/shipping/test_discount.py
@@ -25,16 +25,19 @@ class TestDiscountingMethodsWithoutTax(T
 
     def test_delegates_is_tax_known(self):
         basket = Basket()
+        basket.save()
         charge = self.method.calculate(basket)
         self.assertFalse(charge.is_tax_known)
 
     def test_discounts_charge(self):
         basket = Basket()
+        basket.save()
         charge = self.method.calculate(basket)
         self.assertEqual(D('8.00'), charge.excl_tax)
 
     def test_can_have_tax_set_later(self):
         basket = Basket()
+        basket.save()
         charge = self.method.calculate(basket)
         charge.tax = D('1.00')
         self.assertEqual(D('9.00'), charge.incl_tax)
@@ -58,10 +61,12 @@ class TestDiscountingMethodsWithTax(Test
 
     def test_delegates_is_tax_known(self):
         basket = Basket()
+        basket.save()
         charge = self.method.calculate(basket)
         self.assertTrue(charge.is_tax_known)
 
     def test_discounts_charge(self):
         basket = Basket()
+        basket.save()
         charge = self.method.calculate(basket)
         self.assertEqual(D('7.00'), charge.incl_tax)

Reply via email to