diff --git a/0001-bypass-some-test-for-python3.11.patch b/0001-bypass-some-test-for-python3.11.patch deleted file mode 100644 index 33a2d14215d48d03c6578c36401d6285426124ad..0000000000000000000000000000000000000000 --- a/0001-bypass-some-test-for-python3.11.patch +++ /dev/null @@ -1,185 +0,0 @@ -From c592e8cc599a38c5b7a9db8c4664fe67e138dabf Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Thu, 14 Sep 2023 09:58:51 +0800 -Subject: [PATCH] bypass some test for python3.11 - ---- - tests/test_runner/test_debug_sql.py | 44 --------------- - tests/test_utils/tests.py | 84 ----------------------------- - tests/validators/tests.py | 13 ----- - 3 files changed, 141 deletions(-) - -diff --git a/tests/test_runner/test_debug_sql.py b/tests/test_runner/test_debug_sql.py -index 8c4cb6f..af28b96 100644 ---- a/tests/test_runner/test_debug_sql.py -+++ b/tests/test_runner/test_debug_sql.py -@@ -63,47 +63,3 @@ class TestDebugSQL(unittest.TestCase): - - return stream.getvalue() - -- def test_output_normal(self): -- full_output = self._test_output(1) -- for output in self.expected_outputs: -- self.assertIn(output, full_output) -- for output in self.verbose_expected_outputs: -- self.assertNotIn(output, full_output) -- -- def test_output_verbose(self): -- full_output = self._test_output(2) -- for output in self.expected_outputs: -- self.assertIn(output, full_output) -- for output in self.verbose_expected_outputs: -- self.assertIn(output, full_output) -- -- expected_outputs = [ -- ('''SELECT COUNT(*) AS "__count" ''' -- '''FROM "test_runner_person" WHERE ''' -- '''"test_runner_person"."first_name" = 'error';'''), -- ('''SELECT COUNT(*) AS "__count" ''' -- '''FROM "test_runner_person" WHERE ''' -- '''"test_runner_person"."first_name" = 'fail';'''), -- ('''SELECT COUNT(*) AS "__count" ''' -- '''FROM "test_runner_person" WHERE ''' -- '''"test_runner_person"."first_name" = 'subtest-error';'''), -- ('''SELECT COUNT(*) AS "__count" ''' -- '''FROM "test_runner_person" WHERE ''' -- '''"test_runner_person"."first_name" = 'subtest-fail';'''), -- ] -- -- verbose_expected_outputs = [ -- 'runTest (test_runner.test_debug_sql.TestDebugSQL.FailingTest) ... FAIL', -- 'runTest (test_runner.test_debug_sql.TestDebugSQL.ErrorTest) ... ERROR', -- 'runTest (test_runner.test_debug_sql.TestDebugSQL.PassingTest) ... ok', -- # If there are errors/failures in subtests but not in test itself, -- # the status is not written. That behavior comes from Python. -- 'runTest (test_runner.test_debug_sql.TestDebugSQL.FailingSubTest) ...', -- 'runTest (test_runner.test_debug_sql.TestDebugSQL.ErrorSubTest) ...', -- ('''SELECT COUNT(*) AS "__count" ''' -- '''FROM "test_runner_person" WHERE ''' -- '''"test_runner_person"."first_name" = 'pass';'''), -- ('''SELECT COUNT(*) AS "__count" ''' -- '''FROM "test_runner_person" WHERE ''' -- '''"test_runner_person"."first_name" = 'subtest-pass';'''), -- ] -diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py -index a1a113a..513ac73 100644 ---- a/tests/test_utils/tests.py -+++ b/tests/test_utils/tests.py -@@ -38,90 +38,6 @@ class SkippingTestCase(SimpleTestCase): - except unittest.SkipTest: - self.fail('%s should not result in a skipped test.' % func.__name__) - -- def test_skip_unless_db_feature(self): -- """ -- Testing the django.test.skipUnlessDBFeature decorator. -- """ -- # Total hack, but it works, just want an attribute that's always true. -- @skipUnlessDBFeature("__class__") -- def test_func(): -- raise ValueError -- -- @skipUnlessDBFeature("notprovided") -- def test_func2(): -- raise ValueError -- -- @skipUnlessDBFeature("__class__", "__class__") -- def test_func3(): -- raise ValueError -- -- @skipUnlessDBFeature("__class__", "notprovided") -- def test_func4(): -- raise ValueError -- -- self._assert_skipping(test_func, ValueError) -- self._assert_skipping(test_func2, unittest.SkipTest) -- self._assert_skipping(test_func3, ValueError) -- self._assert_skipping(test_func4, unittest.SkipTest) -- -- class SkipTestCase(SimpleTestCase): -- @skipUnlessDBFeature('missing') -- def test_foo(self): -- pass -- -- self._assert_skipping( -- SkipTestCase('test_foo').test_foo, -- ValueError, -- "skipUnlessDBFeature cannot be used on test_foo (test_utils.tests." -- "SkippingTestCase.test_skip_unless_db_feature..SkipTestCase) " -- "as SkippingTestCase.test_skip_unless_db_feature..SkipTestCase " -- "doesn't allow queries against the 'default' database." -- ) -- -- def test_skip_if_db_feature(self): -- """ -- Testing the django.test.skipIfDBFeature decorator. -- """ -- @skipIfDBFeature("__class__") -- def test_func(): -- raise ValueError -- -- @skipIfDBFeature("notprovided") -- def test_func2(): -- raise ValueError -- -- @skipIfDBFeature("__class__", "__class__") -- def test_func3(): -- raise ValueError -- -- @skipIfDBFeature("__class__", "notprovided") -- def test_func4(): -- raise ValueError -- -- @skipIfDBFeature("notprovided", "notprovided") -- def test_func5(): -- raise ValueError -- -- self._assert_skipping(test_func, unittest.SkipTest) -- self._assert_skipping(test_func2, ValueError) -- self._assert_skipping(test_func3, unittest.SkipTest) -- self._assert_skipping(test_func4, unittest.SkipTest) -- self._assert_skipping(test_func5, ValueError) -- -- class SkipTestCase(SimpleTestCase): -- @skipIfDBFeature('missing') -- def test_foo(self): -- pass -- -- self._assert_skipping( -- SkipTestCase('test_foo').test_foo, -- ValueError, -- "skipIfDBFeature cannot be used on test_foo (test_utils.tests." -- "SkippingTestCase.test_skip_if_db_feature..SkipTestCase) " -- "as SkippingTestCase.test_skip_if_db_feature..SkipTestCase " -- "doesn't allow queries against the 'default' database." -- ) -- - - class SkippingClassTestCase(TestCase): - def test_skip_class_unless_db_feature(self): -diff --git a/tests/validators/tests.py b/tests/validators/tests.py -index 1f09fb5..dbc9f66 100644 ---- a/tests/validators/tests.py -+++ b/tests/validators/tests.py -@@ -338,19 +338,6 @@ with open(create_path('invalid_urls.txt'), encoding='utf8') as f: - - class TestValidators(SimpleTestCase): - -- def test_validators(self): -- for validator, value, expected in TEST_DATA: -- name = validator.__name__ if isinstance(validator, types.FunctionType) else validator.__class__.__name__ -- exception_expected = expected is not None and issubclass(expected, Exception) -- with self.subTest(name, value=value): -- if validator is validate_image_file_extension and not PILLOW_IS_INSTALLED: -- self.skipTest('Pillow is required to test validate_image_file_extension.') -- if exception_expected: -- with self.assertRaises(expected): -- validator(value) -- else: -- self.assertEqual(expected, validator(value)) -- - def test_single_message(self): - v = ValidationError('Not Valid') - self.assertEqual(str(v), "['Not Valid']") --- -2.37.3 - diff --git a/Django-2.0-skip-net-tests.patch b/Django-2.0-skip-net-tests.patch deleted file mode 100644 index c4ef66b3a13af28c26d5bee4ad484168e3672a82..0000000000000000000000000000000000000000 --- a/Django-2.0-skip-net-tests.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Naur django-4.1.8.orig/tests/mail/tests.py django-4.1.8/tests/mail/tests.py ---- django-4.1.8.orig/tests/mail/tests.py 2023-04-21 11:53:25.287291835 +0800 -+++ django-4.1.8/tests/mail/tests.py 2023-04-21 11:54:26.106266270 +0800 -@@ -1895,20 +1895,6 @@ - connection = mail.get_connection("django.core.mail.backends.smtp.EmailBackend") - self.assertIsNone(connection.timeout) - -- def test_connection_timeout_custom(self): -- """The timeout parameter can be customized.""" -- -- class MyEmailBackend(smtp.EmailBackend): -- def __init__(self, *args, **kwargs): -- kwargs.setdefault("timeout", 42) -- super().__init__(*args, **kwargs) -- -- myemailbackend = MyEmailBackend() -- myemailbackend.open() -- self.assertEqual(myemailbackend.timeout, 42) -- self.assertEqual(myemailbackend.connection.timeout, 42) -- myemailbackend.close() -- - @override_settings(EMAIL_TIMEOUT=10) - def test_email_timeout_override_settings(self): - backend = smtp.EmailBackend() diff --git a/disable-test-custom-fields.patch b/disable-test-custom-fields.patch deleted file mode 100644 index c069a2a9345f5ca35ea379eff8f41ceb2ad73e05..0000000000000000000000000000000000000000 --- a/disable-test-custom-fields.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff -Naur django-2.2.28.orig/tests/inspectdb/tests.py django-2.2.28/tests/inspectdb/tests.py ---- django-2.2.28.orig/tests/inspectdb/tests.py 2023-04-23 12:55:43.674836361 +0800 -+++ django-2.2.28/tests/inspectdb/tests.py 2023-04-23 12:59:24.888765076 +0800 -@@ -249,26 +249,6 @@ - with connection.cursor() as c: - c.execute('DROP INDEX Findex') - -- @skipUnless(connection.vendor == 'sqlite', -- "Only patched sqlite's DatabaseIntrospection.data_types_reverse for this test") -- def test_custom_fields(self): -- """ -- Introspection of columns with a custom field (#21090) -- """ -- out = StringIO() -- orig_data_types_reverse = connection.introspection.data_types_reverse -- try: -- connection.introspection.data_types_reverse = { -- 'text': 'myfields.TextField', -- 'bigint': 'BigIntegerField', -- } -- call_command('inspectdb', 'inspectdb_columntypes', stdout=out) -- output = out.getvalue() -- self.assertIn("text_field = myfields.TextField()", output) -- self.assertIn("big_int_field = models.BigIntegerField()", output) -- finally: -- connection.introspection.data_types_reverse = orig_data_types_reverse -- - def test_introspection_errors(self): - """ - Introspection errors should not crash the command, and the error should diff --git a/python-django.spec b/python-django.spec index f0a1677d565c5bd3ae7218464b0ce3f48da3a5d5..212d99c8507c2b4eecdc5bda91855f8b808360ad 100644 --- a/python-django.spec +++ b/python-django.spec @@ -2,17 +2,12 @@ Summary: A high-level Python Web framework Name: python-django -Version: 2.2.28 -Release: 6%{?dist} +Version: 4.2.5 +Release: 1%{?dist} License: BSD URL: https://www.djangoproject.com/ Source0: https://github.com/django/django/archive/refs/tags/%{version}.tar.gz -Patch5000: disable-test-custom-fields.patch - -# this patch is supported to be removed when python-django updating -Patch5001: 0001-bypass-some-test-for-python3.11.patch - BuildArch: noarch @@ -46,7 +41,7 @@ Python Web framework. %package -n python3-django Summary: A high-level Python Web framework BuildRequires: python3-devel python3-setuptools python3-pytz python3-sqlparse python-selenium python3-sphinx -BuildRequires: /usr/bin/pathfix.py +BuildRequires: /usr/bin/pathfix.py python3-asgiref Requires: python3-pytz python3-sqlparse python3-argon2-cffi python3-bcrypt Provides: python-Django, python3-django @@ -60,13 +55,6 @@ without needing to reinvent the wheel. It’s free and open source. %prep %setup -q -n django-%{version} -%patch5000 -p1 - -# remove it when django update -%if "%{python3_version}" == "3.11" -%patch5001 -p1 -%endif - pathfix.py -pni "%{__python3} %{py3_shbang_opts}" . %build @@ -116,7 +104,6 @@ python3 runtests.py --settings=test_sqlite --verbosity=2 --parallel 1 %license LICENSE %doc AUTHORS README.rst %{_bindir}/django-admin -%{_bindir}/django-admin.py %{_bindir}/django-admin-3 %{_bindir}/django-admin-%{python3_version} %{_bindir}/python3-django-admin @@ -125,6 +112,9 @@ python3 runtests.py --settings=test_sqlite --verbosity=2 --parallel 1 %changelog +* Thu Sep 28 2023 cunshunxia - 4.2.5-1 +- Upgrade to version 4.2.5 + * Tue Sep 19 2023 OpenCloudOS Release Engineering - 2.2.28-6 - Rebuilt for python 3.11 diff --git a/sources b/sources index 30fedcf85ad9d9f0c7248f69bddcb5b121cc79a1..842254678e9c85e3948252863b8c6fe8795ba165 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (2.2.28.tar.gz) = 5023d2ef889b3470c0e39be5c3bf7cf0ac1892122ad02aa548fc13d5ada4edec5df20e6cfbcd683ba99420ff1400550ae7dc7609b151415171e05df59b39a3a6 +SHA512 (4.2.5.tar.gz) = 5a0ee6928634d8b07bb35fd2064521b3b2f505930ff2cabb9709f914246cb141f87df7e45ee3f9357353302c9f7460a60a311d87a4ff727c603b865f81e2915a