Skip to content

Commit

Permalink
tests: (de)serialization of array of IPs
Browse files Browse the repository at this point in the history
  • Loading branch information
pennersr committed Feb 5, 2025
1 parent 62b7013 commit 031e26b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions allauth/core/internal/tests/test_modelkit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from datetime import date, datetime

from django.contrib.postgres.fields import ArrayField
from django.core.files.base import ContentFile
from django.db import models

Expand Down Expand Up @@ -27,6 +28,7 @@ class SomeModel(models.Model):
img2 = models.ImageField()
img3 = models.ImageField()
something = SomeField()
ips = ArrayField(models.GenericIPAddressField(), default=list, blank=True)

def method(self):
pass
Expand All @@ -36,6 +38,7 @@ def method(self):
d=date.today(),
something=some_value,
t=datetime.now().time(),
ips=["1.1.1.1", "1.2.3.4"],
)
instance.img1 = ContentFile(b"%PDF", name="foo.pdf")
instance.img2 = ContentFile(
Expand All @@ -59,6 +62,7 @@ def method(self):
assert instance.nonfield == instance2.nonfield
assert instance.d == instance2.d
assert instance.dt.date() == instance2.dt.date()
assert instance.ips == instance2.ips
for t1, t2 in [
(instance.t, instance2.t),
(instance.dt.time(), instance2.dt.time()),
Expand Down
1 change: 1 addition & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ stdenv.mkDerivation {
python311Packages.python3-openid
python311Packages.python3-saml
python311Packages.pyjwt
python311Packages.psycopg
python311Packages.qrcode
python311Packages.sphinx-rtd-theme
python311Packages.requests-oauthlib
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ deps =
djangomain: git+https://github.com/django/django.git@main#egg=django
python3-saml>=1.15.0,<2.0.0
pyyaml>=6.0.2
psycopg2>=2.9.10,<3
djangorestframework>=3.15.2,<4
django-ninja>=1.3.0,<2
extras =
Expand Down

0 comments on commit 031e26b

Please sign in to comment.