Skip to content

Commit 031e26b

Browse files
committed
tests: (de)serialization of array of IPs
1 parent 62b7013 commit 031e26b

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

allauth/core/internal/tests/test_modelkit.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from datetime import date, datetime
22

3+
from django.contrib.postgres.fields import ArrayField
34
from django.core.files.base import ContentFile
45
from django.db import models
56

@@ -27,6 +28,7 @@ class SomeModel(models.Model):
2728
img2 = models.ImageField()
2829
img3 = models.ImageField()
2930
something = SomeField()
31+
ips = ArrayField(models.GenericIPAddressField(), default=list, blank=True)
3032

3133
def method(self):
3234
pass
@@ -36,6 +38,7 @@ def method(self):
3638
d=date.today(),
3739
something=some_value,
3840
t=datetime.now().time(),
41+
ips=["1.1.1.1", "1.2.3.4"],
3942
)
4043
instance.img1 = ContentFile(b"%PDF", name="foo.pdf")
4144
instance.img2 = ContentFile(
@@ -59,6 +62,7 @@ def method(self):
5962
assert instance.nonfield == instance2.nonfield
6063
assert instance.d == instance2.d
6164
assert instance.dt.date() == instance2.dt.date()
65+
assert instance.ips == instance2.ips
6266
for t1, t2 in [
6367
(instance.t, instance2.t),
6468
(instance.dt.time(), instance2.dt.time()),

shell.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ stdenv.mkDerivation {
2828
python311Packages.python3-openid
2929
python311Packages.python3-saml
3030
python311Packages.pyjwt
31+
python311Packages.psycopg
3132
python311Packages.qrcode
3233
python311Packages.sphinx-rtd-theme
3334
python311Packages.requests-oauthlib

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ deps =
3232
djangomain: git+https://github.com/django/django.git@main#egg=django
3333
python3-saml>=1.15.0,<2.0.0
3434
pyyaml>=6.0.2
35+
psycopg2>=2.9.10,<3
3536
djangorestframework>=3.15.2,<4
3637
django-ninja>=1.3.0,<2
3738
extras =

0 commit comments

Comments
 (0)