Skip to content

Commit

Permalink
Merge pull request #242 from winged/dependencies_bump
Browse files Browse the repository at this point in the history
Dependencies bump
  • Loading branch information
David Vogt authored Jul 22, 2021
2 parents adbe814 + fd7fd36 commit e0becfd
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.6.13-slim-buster@sha256:596c35c09d59adf2afbefa3aa970f26ac3ba3c2396c6766a7c73086ac850d416
FROM python:3.9.6-slim-buster
WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends libpq-dev wget build-essential \
Expand Down
2 changes: 1 addition & 1 deletion emeis/core/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DefaultConfig(AppConfig):
label = "emeis_core"

def ready(self):
from .models import VisibilityMixin, PermissionMixin
from .models import PermissionMixin, VisibilityMixin

# to avoid recursive import error, load extension classes
# only once the app is ready
Expand Down
5 changes: 4 additions & 1 deletion emeis/core/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ def viewset(request):

@pytest.fixture
def fixture(
deterministic_uuids, django_db_reset_sequences, request, viewset,
deterministic_uuids,
django_db_reset_sequences,
request,
viewset,
):
"""Get fixture and many to many relations of given viewset."""
fixture = request.getfixturevalue(viewset.factory_name)
Expand Down
15 changes: 9 additions & 6 deletions emeis/core/tests/test_visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,15 @@ def filter_queryset_for_user(self, queryset, request):
if not detail:
if use_admin_client:
assert len(result["data"]) == 2
assert sorted(
[
result["data"][0]["attributes"]["username"],
result["data"][1]["attributes"]["username"],
]
) == ["admin", "foo"]
assert (
sorted(
[
result["data"][0]["attributes"]["username"],
result["data"][1]["attributes"]["username"],
]
)
== ["admin", "foo"]
)
else:
assert len(result["data"]) == 0
else:
Expand Down
30 changes: 25 additions & 5 deletions emeis/oidc_auth/tests/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ def test_authentication(
[(False, "", 0), (True, "", 1), (True, "foo@example.com", 1)],
)
def test_authentication_new_user(
db, rf, requests_mock, settings, create_user, email, expected_count,
db,
rf,
requests_mock,
settings,
create_user,
email,
expected_count,
):
settings.OIDC_CREATE_USER = create_user
settings.OIDC_UPDATE_USER = create_user
Expand All @@ -93,7 +99,12 @@ def test_authentication_new_user(
[("1", "foo@example.com", "bar@example.com")],
)
def test_authentication_email_update(
db, rf, requests_mock, settings, user, expected_email,
db,
rf,
requests_mock,
settings,
user,
expected_email,
):
settings.OIDC_UPDATE_USER = True
userinfo = {"sub": "1", "email": expected_email}
Expand All @@ -106,7 +117,10 @@ def test_authentication_email_update(


def test_authentication_idp_502(
db, rf, requests_mock, settings,
db,
rf,
requests_mock,
settings,
):
requests_mock.get(
settings.OIDC_OP_USER_ENDPOINT, status_code=status.HTTP_502_BAD_GATEWAY
Expand All @@ -118,7 +132,10 @@ def test_authentication_idp_502(


def test_authentication_idp_missing_claim(
db, rf, requests_mock, settings,
db,
rf,
requests_mock,
settings,
):
settings.OIDC_USERNAME_CLAIM = "missing"
userinfo = {"sub": "1"}
Expand All @@ -130,7 +147,10 @@ def test_authentication_idp_missing_claim(


def test_authentication_no_client(
db, rf, requests_mock, settings,
db,
rf,
requests_mock,
settings,
):
requests_mock.get(
settings.OIDC_OP_USER_ENDPOINT, status_code=status.HTTP_401_UNAUTHORIZED
Expand Down
4 changes: 1 addition & 3 deletions emeis/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from django.conf.urls import include
from django.urls import path

urlpatterns = [
path("api/v1/", include("emeis.core.urls"),),
]
urlpatterns = [path("api/v1/", include("emeis.core.urls"))]
8 changes: 4 additions & 4 deletions requirements-base.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
django==2.2.20
django-cors-headers==3.4.0
django==2.2.24
django-cors-headers==3.7.0
django-environ==0.4.5
django-filter==2.3.0
django-localized-fields==5.4.2
django_mptt==0.11.0
django-postgres-extra==1.22
djangorestframework==3.12.4
djangorestframework-jsonapi==4.1.0
mozilla-django-oidc==1.2.3
requests==2.24.0
mozilla-django-oidc==1.2.4
requests==2.26.0
uwsgi==2.0.19.1
20 changes: 10 additions & 10 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
-r requirements-base.txt
black==19.10b0
black==21.5b1
django_extensions==3.0.8
factory-boy==2.12.0
factory-boy==3.2.0
flake8==3.8.3
flake8-blind-except==0.1.1
flake8-bugbear==20.1.4
flake8-blind-except==0.2.0
flake8-bugbear==21.4.3
flake8-debugger==3.2.1
flake8-docstrings==1.5.0
flake8-isort==3.0.1
flake8-isort==4.0.0
flake8-string-format==0.3.0
flake8-tuple==0.4.1
gitlint==0.13.1
hypothesis==5.33.0
gitlint==0.15.1
hypothesis==6.13.0
ipython==7.16.1
isort==4.3.21
isort==5.8.0
pdbpp==0.10.2
pre_commit==2.7.1
psycopg2-binary==2.8.6
pytest==6.0.1
pytest==6.2.4
pytest-cov==2.10.1
pytest-django==3.9.0
pytest-env==0.6.2
Expand All @@ -27,4 +27,4 @@ pytest-mock==3.3.1
pytest-randomly==3.4.1
requests-mock==1.8.0
snapshottest==0.5.1
werkzeug==1.0.1
werkzeug==2.0.1
2 changes: 1 addition & 1 deletion requirements-prod.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-r requirements-base.txt
psycopg2==2.8.5
psycopg2==2.8.6
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ DJANGO_SETTINGS_MODULE = emeis.settings
filterwarnings =
error::DeprecationWarning
error::PendingDeprecationWarning
# We don't use LocalizedAutoSlug, but it still keeps warning, so we ignore it for now
ignore:LocalizedAutoSlug is deprecated and will be removed in the next major version.
env =
ADMINS=Test Example <test@example.com>,Test2 <test2@example.com>
LANGUAGES=en,de,fr
Expand Down

0 comments on commit e0becfd

Please sign in to comment.