django-rest-framework icon indicating copy to clipboard operation
django-rest-framework copied to clipboard

intial test of django 5.0 support

Open auvipy opened this issue 1 year ago • 3 comments

this PR aims to check hoe django REST framework stands on django 5.0a1

auvipy avatar Sep 19 '23 07:09 auvipy

=========================== short test summary info ============================ SKIPPED [1] tests/test_model_serializer.py:466: has models.JSONField SKIPPED [1] tests/test_fields.py:667: As Django 4.0 has deprecated pytz, this test should eventually be able to get removed. SKIPPED [1] tests/test_fields.py:675: As Django 4.0 has deprecated pytz, this test should eventually be able to get removed. SKIPPED [1] tests/test_fields.py:685: As Django 4.0 has deprecated pytz, this test should eventually be able to get removed. FAILED tests/test_model_serializer.py::TestRegularFieldMappings::test_field_options FAILED tests/test_model_serializer.py::TestRegularFieldMappings::test_regular_fields FAILED tests/test_model_serializer.py::TestFieldSource::test_named_field_source FAILED tests/test_validators.py::TestUniquenessValidation::test_doesnt_pollute_model FAILED tests/test_validators.py::TestUniquenessTogetherValidation::test_allow_explict_override FAILED tests/test_validators.py::TestUniquenessTogetherValidation::test_default_validator_with_fields_with_source FAILED tests/test_validators.py::TestUniquenessTogetherValidation::test_ignore_read_only_fields FAILED tests/test_validators.py::TestUniquenessTogetherValidation::test_repr FAILED tests/test_validators.py::TestUniqueConstraintValidation::test_repr - ... FAILED tests/test_validators.py::TestUniqueConstraintValidation::test_single_field_uniq_validators FAILED tests/test_fields.py::TestNaiveDateTimeField::test_valid_inputs - Asse... FAILED tests/test_fields.py::TestNaiveDateTimeField::test_outputs - Assertion... =========== 12 failed, 1539 passed, 4 skipped, 4 warnings in 24.81s ============

auvipy avatar Sep 19 '23 08:09 auvipy

was thinking about an idea lately. that is testing django 2.2-4.2 support in a single release v3.15. that would ease migration of very old unsupported django LTS to a more latest LTS quite easily. as we still supporting python 3.6 & 3.7, I believe you can try this. but of course the code need to work!

auvipy avatar Sep 20 '23 16:09 auvipy

I tested the framework against 5.0b1 and it gives the following failed tests.

FAILED tests/test_model_serializer.py::TestRegularFieldMappings::test_regular_fields - AssertionError: "Test[94 chars]ield(max_value=9223372036854775807, min_value=[1390 ch...
FAILED tests/test_model_serializer.py::TestFieldSource::test_named_field_source - AssertionError: "Test[42 chars]ield(max_value=9223372036854775807, min_value=[41 char...
FAILED tests/test_validators.py::TestUniquenessValidation::test_doesnt_pollute_model - assert [<django.core... 0x10fb830e0>] == []
FAILED tests/test_validators.py::TestUniquenessTogetherValidation::test_allow_explict_override - AssertionError: assert 'NoValidators...036854775808)' == 'NoValidators...ntegerField()'
FAILED tests/test_validators.py::TestUniquenessTogetherValidation::test_default_validator_with_fields_with_source - assert "TestSerializ...position'))>]" == "TestSerializ...position'))>]"
FAILED tests/test_validators.py::TestUniquenessTogetherValidation::test_ignore_read_only_fields - AssertionError: assert 'ReadOnlyFiel...equired=True)' == 'ReadOnlyFiel...equired=True)'
FAILED tests/test_validators.py::TestUniquenessTogetherValidation::test_repr - assert "UniquenessTo...position'))>]" == "UniquenessTo...position'))>]"
FAILED tests/test_validators.py::TestUniqueConstraintValidation::test_repr - assert "UniqueConstr...position'))>]" == "UniqueConstr...position'))>]"
FAILED tests/test_validators.py::TestUniqueConstraintValidation::test_single_field_uniq_validators - assert 3 == 1
FAILED tests/test_fields.py::TestNaiveDateTimeField::test_valid_inputs - AssertionError: input value: datetime.datetime(2001, 1, 1, 13, 0, tzinfo=datetime.tim...
FAILED tests/test_fields.py::TestNaiveDateTimeField::test_outputs - AssertionError: output value: datetime.datetime(2001, 1, 1, 13, 0)
=============== 12 failed, 1396 passed, 148 skipped, 3 warnings in 14.58s ================

@auvipy Any idea how to proceed from here?

AmiZya avatar Nov 09 '23 16:11 AmiZya

Superseeded by https://github.com/encode/django-rest-framework/pull/9233

tomchristie avatar Mar 18 '24 14:03 tomchristie