Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump zgw-consumers to 0.35.1, commonground-api-common to 2.0.1, OAF to 0.9.0 #33

Merged
merged 4 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-reco
pkg-config \
build-essential \
# only relevant when using editable/github dependencies, which is discouraged
# git \
libpq-dev \
shared-mime-info \
&& rm -rf /var/lib/apt/lists/*
Expand Down
22 changes: 11 additions & 11 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
amqp==5.2.0
# via kombu
ape-pie==0.2.0
# via zgw-consumers
# via
# commonground-api-common
# notifications-api-common
# zgw-consumers
asgiref==3.8.1
# via
# django
Expand Down Expand Up @@ -56,7 +59,7 @@ click-plugins==1.1.1
# via celery
click-repl==0.3.0
# via celery
commonground-api-common==1.13.2
commonground-api-common==2.1.0
# via open-api-framework
coreapi==2.3.3
# via commonground-api-common
Expand Down Expand Up @@ -201,10 +204,6 @@ flower==2.0.1
# via open-api-framework
furl==2.1.3
# via ape-pie
gemma-zds-client==2.0.0
# via
# commonground-api-common
# notifications-api-common
glom==23.5.0
# via mozilla-django-oidc-db
humanize==4.10.0
Expand Down Expand Up @@ -239,7 +238,7 @@ mozilla-django-oidc==4.0.1
# via mozilla-django-oidc-db
mozilla-django-oidc-db==0.19.0
# via open-api-framework
notifications-api-common==0.2.2
notifications-api-common==0.3.1
# via commonground-api-common
open-api-framework==0.8.1
# via -r requirements/base.in
Expand All @@ -264,7 +263,6 @@ pycparser==2.22
pyjwt==2.8.0
# via
# commonground-api-common
# gemma-zds-client
# zgw-consumers
pyopenssl==24.2.1
# via
Expand All @@ -288,7 +286,6 @@ pyyaml==6.0.1
# via
# drf-spectacular
# drf-yasg
# gemma-zds-client
# oyaml
qrcode==7.4.2
# via django-two-factor-auth
Expand All @@ -304,10 +301,12 @@ requests==2.32.3
# commonground-api-common
# coreapi
# django-log-outgoing-requests
# gemma-zds-client
# mozilla-django-oidc
# open-api-framework
# requests-mock
# zgw-consumers
requests-mock==1.12.1
# via commonground-api-common
rpds-py==0.19.1
# via
# jsonschema
Expand Down Expand Up @@ -359,7 +358,8 @@ webencodings==0.5.1
# via bleach
wrapt==1.16.0
# via elastic-apm
zgw-consumers==0.34.0
zgw-consumers==0.35.1
# via
# commonground-api-common
# notifications-api-common
# open-api-framework
22 changes: 10 additions & 12 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ amqp==5.2.0
ape-pie==0.2.0
# via
# -r requirements/base.txt
# commonground-api-common
# notifications-api-common
# zgw-consumers
asgiref==3.8.1
# via
Expand Down Expand Up @@ -96,7 +98,7 @@ click-repl==0.3.0
# celery
codecov==2.1.13
# via -r requirements/ci.in
commonground-api-common==1.13.2
commonground-api-common==2.1.0
# via
# -r requirements/base.txt
# open-api-framework
Expand Down Expand Up @@ -338,11 +340,6 @@ furl==2.1.3
# via
# -r requirements/base.txt
# ape-pie
gemma-zds-client==2.0.0
# via
# -r requirements/base.txt
# commonground-api-common
# notifications-api-common
glom==23.5.0
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -424,7 +421,7 @@ multidict==6.0.5
# via yarl
mypy-extensions==1.0.0
# via black
notifications-api-common==0.2.2
notifications-api-common==0.3.1
# via
# -r requirements/base.txt
# commonground-api-common
Expand Down Expand Up @@ -485,7 +482,6 @@ pyjwt==2.8.0
# via
# -r requirements/base.txt
# commonground-api-common
# gemma-zds-client
# zgw-consumers
pyopenssl==24.2.1
# via
Expand Down Expand Up @@ -525,7 +521,6 @@ pyyaml==6.0.1
# -r requirements/base.txt
# drf-spectacular
# drf-yasg
# gemma-zds-client
# oyaml
# vcrpy
qrcode==7.4.2
Expand All @@ -549,14 +544,16 @@ requests==2.32.3
# commonground-api-common
# coreapi
# django-log-outgoing-requests
# gemma-zds-client
# mozilla-django-oidc
# open-api-framework
# requests-mock
# sphinx
# zgw-consumers
requests-mock==1.12.1
# via -r requirements/test-tools.in
# via
# -r requirements/base.txt
# -r requirements/test-tools.in
# commonground-api-common
rpds-py==0.19.1
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -672,8 +669,9 @@ wrapt==1.16.0
# vcrpy
yarl==1.9.4
# via vcrpy
zgw-consumers==0.34.0
zgw-consumers==0.35.1
# via
# -r requirements/base.txt
# commonground-api-common
# notifications-api-common
# open-api-framework
28 changes: 12 additions & 16 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ amqp==5.2.0
ape-pie==0.2.0
# via
# -r requirements/base.txt
# commonground-api-common
# notifications-api-common
# zgw-consumers
asgiref==3.8.1
# via
Expand Down Expand Up @@ -99,7 +101,7 @@ click-repl==0.3.0
# via
# -r requirements/base.txt
# celery
commonground-api-common==1.13.2
commonground-api-common==2.1.0
# via
# -r requirements/base.txt
# open-api-framework
Expand Down Expand Up @@ -307,8 +309,7 @@ drf-spectacular[sidecar]==0.27.2
# open-api-framework
drf-spectacular-sidecar==2024.7.1
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
# -r requirements/base.txt
# drf-spectacular
drf-yasg==1.21.7
# via
Expand Down Expand Up @@ -346,11 +347,6 @@ furl==2.1.3
# via
# -r requirements/base.txt
# ape-pie
gemma-zds-client==2.0.0
# via
# -r requirements/base.txt
# commonground-api-common
# notifications-api-common
gitdb==4.0.11
# via gitpython
gitpython==3.1.43
Expand Down Expand Up @@ -434,13 +430,12 @@ multidict==6.0.5
# via yarl
mypy-extensions==1.0.0
# via black
notifications-api-common==0.2.2
notifications-api-common==0.3.1
# via
# -r requirements/base.txt
# commonground-api-common
open-api-framework==0.8.1
# via
# -r requirements/base.txt
# via -r requirements/base.txt
openpyxl==3.1.5
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -496,7 +491,6 @@ pyjwt==2.8.0
# via
# -r requirements/base.txt
# commonground-api-common
# gemma-zds-client
# zgw-consumers
pyopenssl==24.2.1
# via
Expand Down Expand Up @@ -538,7 +532,6 @@ pyyaml==6.0.1
# -r requirements/base.txt
# drf-spectacular
# drf-yasg
# gemma-zds-client
# oyaml
# vcrpy
qrcode==7.4.2
Expand All @@ -561,14 +554,16 @@ requests==2.32.3
# commonground-api-common
# coreapi
# django-log-outgoing-requests
# gemma-zds-client
# mozilla-django-oidc
# open-api-framework
# requests-mock
# sphinx
# zgw-consumers
requests-mock==1.12.1
# via -r requirements/test-tools.in
# via
# -r requirements/base.txt
# -r requirements/test-tools.in
# commonground-api-common
rpds-py==0.19.1
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -689,9 +684,10 @@ wrapt==1.16.0
# vcrpy
yarl==1.9.4
# via vcrpy
zgw-consumers==0.34.0
zgw-consumers==0.35.1
# via
# -r requirements/base.txt
# commonground-api-common
# notifications-api-common
# open-api-framework

Expand Down
21 changes: 10 additions & 11 deletions src/referentielijsten/api/tests/test_items.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
from django.test import override_settings
from django.urls import reverse_lazy

from freezegun import freeze_time
from rest_framework import status
from rest_framework.test import APITestCase
from vng_api_common.tests import reverse

from ..models import Item
from .factories import ItemFactory, TabelFactory


@override_settings(USE_TZ=False)
class ItemsApiTests(APITestCase):
url = reverse_lazy("item-list", kwargs={"version": 1})

def test_items_with_no_tabel_code(self):
url = reverse(Item)
ItemFactory.create_batch(3)

response = self.client.get(url)
response = self.client.get(self.url)
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(
response.json()["invalidParams"],
Expand All @@ -29,14 +29,13 @@ def test_items_with_no_tabel_code(self):
)

def test_items_with_tabel_code(self):
url = reverse(Item)
tabel = TabelFactory.create(code="123")
item1, item2, item3 = ItemFactory.create_batch(3, tabel=tabel)

tabel2 = TabelFactory.create(code="456")
ItemFactory.create_batch(3, tabel=tabel2)

response = self.client.get(url, {"tabel__code": "123"})
response = self.client.get(self.url, {"tabel__code": "123"})
self.assertEqual(response.status_code, status.HTTP_200_OK)
response_data = response.json()

Expand All @@ -48,20 +47,18 @@ def test_items_with_tabel_code(self):
self.assertEqual(results[2]["code"], item3.code)

def test_items_with_none_existing_tabel_code(self):
url = reverse(Item)
TabelFactory.create(code="123")
TabelFactory.create(code="456")
TabelFactory.create(code="789")

response = self.client.get(url, {"tabel__code": "123456789"})
response = self.client.get(self.url, {"tabel__code": "123456789"})
self.assertEqual(response.status_code, status.HTTP_200_OK)
response_data = response.json()

self.assertEqual(response_data["count"], 0)

@freeze_time("2024-01-01 00:00:00")
def test_items_is_geldig(self):
url = reverse(Item)
tabel = TabelFactory.create(code="123")
ItemFactory(tabel=tabel, code="1", naam="geldig geen begindatum en einddatum")
ItemFactory(
Expand Down Expand Up @@ -97,7 +94,7 @@ def test_items_is_geldig(self):
einddatum_geldigheid="2023-01-01 00:00:00",
)

response = self.client.get(url, {"tabel__code": "123", "isGeldig": "true"})
response = self.client.get(self.url, {"tabel__code": "123", "isGeldig": "true"})
self.assertEqual(response.status_code, status.HTTP_200_OK)
response_data = response.json()

Expand All @@ -109,7 +106,9 @@ def test_items_is_geldig(self):
self.assertEqual(results[2]["code"], "3")
self.assertEqual(results[3]["code"], "4")

response = self.client.get(url, {"tabel__code": "123", "isGeldig": "false"})
response = self.client.get(
self.url, {"tabel__code": "123", "isGeldig": "false"}
)
self.assertEqual(response.status_code, status.HTTP_200_OK)
response_data = response.json()

Expand Down
Loading