Skip to content

Commit 0fbaebc

Browse files
MehrazRummanauvipybrowniebroke
authored
Add Django 6.0 support (#9819)
* adding django6.0a support * test fixed * gitignore updated * pre-commit applied * test issue 1386 fixed * fixing test issue 1386 * .gov domain handled for different version * correct urls updated * Modify URL test cases for Django version compatibility Adjust URL test cases based on Django version. * Add Django import to test_templatetags.py * Reorder import statements in test file * Update tox.ini * Update tox.ini * Revert unnecessary changes in tests * Default to AutoField for now * Add Django upper bound to base and dist tests to avoid testing on unsupported versions --------- Co-authored-by: Asif Saif Uddin {"Auvi":"অভি"} <[email protected]> Co-authored-by: Bruno Alla <[email protected]>
1 parent 7eed4ab commit 0fbaebc

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def pytest_configure(config):
1515

1616
settings.configure(
1717
DEBUG_PROPAGATE_EXCEPTIONS=True,
18+
DEFAULT_AUTO_FIELD="django.db.models.AutoField",
1819
DATABASES={
1920
'default': {
2021
'ENGINE': 'django.db.backends.sqlite3',

tests/test_templatetags.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unittest
22

33
from django.template import Context, Template
4-
from django.test import TestCase
4+
from django.test import TestCase, override_settings
55
from django.utils.html import urlize
66

77
from rest_framework.compat import coreapi, coreschema
@@ -240,6 +240,7 @@ class Issue1386Tests(TestCase):
240240
Covers #1386
241241
"""
242242

243+
@override_settings(URLIZE_ASSUME_HTTPS=True)
243244
def test_issue_1386(self):
244245
"""
245246
Test function urlize with different args

tests/test_validators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ def test_single_field_uniq_validators(self):
752752

753753
validators = serializer.fields['fancy_conditions'].validators
754754
assert len(validators) == 2 + extra_validators_qty
755-
ids_in_qs = {frozenset(v.queryset.values_list(flat=True)) for v in validators if hasattr(v, "queryset")}
755+
ids_in_qs = {frozenset(v.queryset.values_list('id', flat=True)) for v in validators if hasattr(v, "queryset")}
756756
assert ids_in_qs == {frozenset([1]), frozenset([3])}
757757

758758
def test_nullable_unique_constraint_fields_are_not_required(self):

tox.ini

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
envlist =
33
{py310}-{django42,django51,django52}
44
{py311}-{django42,django51,django52}
5-
{py312}-{django42,django51,django52,djangomain}
6-
{py313}-{django51,django52,djangomain}
7-
{py314}-{django52,djangomain}
5+
{py312}-{django42,django51,django52,django60,djangomain}
6+
{py313}-{django51,django52,django60,djangomain}
7+
{py314}-{django52,django60,djangomain}
88
base
99
dist
1010
docs
@@ -20,20 +20,21 @@ deps =
2020
django50: Django>=5.0,<5.1
2121
django51: Django>=5.1,<5.2
2222
django52: Django>=5.2,<6.0
23+
django60: Django>=6.0,<6.1
2324
djangomain: https://github.com/django/django/archive/main.tar.gz
2425
-rrequirements/requirements-testing.txt
2526
-rrequirements/requirements-optionals.txt
2627

2728
[testenv:base]
2829
; Ensure optional dependencies are not required
2930
deps =
30-
django<6.0
31+
django<6.1
3132
-rrequirements/requirements-testing.txt
3233

3334
[testenv:dist]
3435
commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning runtests.py --no-pkgroot --staticfiles {posargs}
3536
deps =
36-
django<6.0
37+
django<6.1
3738
-rrequirements/requirements-testing.txt
3839
-rrequirements/requirements-optionals.txt
3940

0 commit comments

Comments
 (0)