Skip to content

Commit f4f4c0a

Browse files
committed
tests: ipaddress IPv6 vs python3.8
1 parent 03100c6 commit f4f4c0a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/apps/account/test_adapter.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from http import HTTPStatus
23

34
from django.core.exceptions import PermissionDenied
@@ -44,10 +45,17 @@ def test_adapter_pre_login(settings, user, user_password, client):
4445
("2001:db8::1:0", "2001:db8::1:0"),
4546
("[2001:db8::1:0]:12345", "2001:db8::1:0"),
4647
("::abc:7:def", "::abc:7:def"),
47-
("fe80::1234%1", "fe80::1234%1"),
4848
("::1", "::1"),
4949
("[::1]:12345", "::1"),
50-
],
50+
]
51+
+ (
52+
[
53+
# not supported by ipaddress py3.8
54+
("fe80::1234%1", "fe80::1234%1"),
55+
]
56+
if sys.version_info >= (3, 9)
57+
else []
58+
),
5159
)
5260
def test_get_client_ip_vs_x_forwarded_for(rf, x_forwarded_for, expected_ip):
5361
request = rf.get("/", HTTP_X_FORWARDED_FOR=x_forwarded_for)

0 commit comments

Comments
 (0)