Skip to content

Commit

Permalink
Django 4.2.7 and other updates (#456)
Browse files Browse the repository at this point in the history
* Update to django 4.2.7 and update other dependencies

* Nordigen changed their domain, change tests to not care about the domain part

* update local bootstrap4 and remove old bootstrap files
  • Loading branch information
tswfi authored Dec 4, 2023
1 parent a143282 commit 572d257
Show file tree
Hide file tree
Showing 10 changed files with 872 additions and 869 deletions.
8 changes: 2 additions & 6 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ black = "*"
werkzeug = "*"

[packages]
django = "==4.1.*"
django = "==4.2.*"
djangorestframework = "*"
# django 4 support from a fork for now
# see https://pypi.org/project/django-rest-auth-forked/
# https://github.com/Tivix/django-rest-auth/pulls?q=is%3Apr+is%3Aopen+%27django+4.0%27+
#django-rest-auth = "*"
django-rest-auth-forked = "*"
dj-rest-auth = "*"
django-allauth = "*"
django-extensions = "*"
coreapi = "*"
Expand Down
1,688 changes: 854 additions & 834 deletions Pipfile.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
router.register(r"banktransactionaggregate", userviews.BankTransactionAggregateViewSet, basename="banktransactionaggregate")

urlpatterns = [
path("auth/", include("rest_auth.urls")),
path("auth/registration/", include("rest_auth.registration.urls")),
path("auth/", include("dj_rest_auth.urls")),
path("auth/registration/", include("dj_rest_auth.registration.urls")),
path("users/", include("users.urls")),
path("", include(router.urls)),
]
4 changes: 2 additions & 2 deletions drfx/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@
# drf and its authentication friends
"rest_framework",
"rest_framework.authtoken",
"rest_auth",
"django.contrib.sites",
"allauth",
"allauth.account",
"allauth.socialaccount",
"dj_rest_auth",
# for logging some sensitive endpoints like access
"rest_framework_tracking",
# filters
Expand All @@ -88,7 +88,6 @@
# constance settings manager
"constance.backends.database",
"constance",
"rest_auth.registration",
# our api and other apps
"api",
"users",
Expand Down Expand Up @@ -139,6 +138,7 @@
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"users.middleware.language.UserLanguageMiddleware",
"allauth.account.middleware.AccountMiddleware",
]

ROOT_URLCONF = "drfx.urls"
Expand Down
22 changes: 10 additions & 12 deletions nordigenautomation/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def mocked_requests_get(*args, **kwargs):
request_url = kwargs.get("url", None)
# print(f"mocking get request to: {request_url}")
# institutions, bit truncated
if request_url == "https://ob.nordigen.com/api/v2/institutions/?country=FI":
if request_url.endswith("/api/v2/institutions/?country=FI"):
response_content = json.dumps(
[
{
Expand Down Expand Up @@ -44,9 +44,8 @@ def mocked_requests_get(*args, **kwargs):
},
]
)
elif (
request_url
== "https://ob.nordigen.com/api/v2/requisitions/3fa85f64-5717-4562-b3fc-2c963f66afa6/"
elif request_url.endswith(
"/api/v2/requisitions/3fa85f64-5717-4562-b3fc-2c963f66afa6/"
):
response_content = json.dumps(
{
Expand All @@ -69,9 +68,8 @@ def mocked_requests_get(*args, **kwargs):
"redirect_immediate": False,
}
)
elif (
request_url
== "https://ob.nordigen.com/api/v2/accounts/3fa85f64-5717-4562-b3fc-2c963f66afa6/transactions/"
elif request_url.endswith(
"/api/v2/accounts/3fa85f64-5717-4562-b3fc-2c963f66afa6/transactions/"
):
response_content = json.dumps(
{
Expand Down Expand Up @@ -115,7 +113,7 @@ def mocked_requests_get(*args, **kwargs):
}
}
)
elif request_url == "https://ob.nordigen.com/api/v2/institutions/?country=FI":
elif request_url.endswith("/api/v2/institutions/?country=FI"):
response_content = json.dumps(
[
{
Expand Down Expand Up @@ -156,7 +154,7 @@ def mocked_requests_post(*args, **kwargs):
request_url = kwargs.get("url", None)
# print(f"mocking post request to: {request_url}")
# always return a valid token
if request_url == "https://ob.nordigen.com/api/v2/token/new/":
if request_url.endswith("/api/v2/token/new/"):
response_content = json.dumps(
{
"access": "string",
Expand All @@ -166,10 +164,10 @@ def mocked_requests_post(*args, **kwargs):
}
)
# and refreshtoken too
elif request_url == "https://ob.nordigen.com/api/v2/token/refresh/":
elif request_url.endswith("/api/v2/token/refresh/"):
response_content = json.dumps({"access": "string", "access_expires": 86400})

elif request_url == "https://ob.nordigen.com/api/v2/agreements/enduser/":
elif request_url.endswith("/api/v2/agreements/enduser/"):
response_content = json.dumps(
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
Expand All @@ -181,7 +179,7 @@ def mocked_requests_post(*args, **kwargs):
"institution_id": "string",
}
)
elif request_url == "https://ob.nordigen.com/api/v2/requisitions/":
elif request_url.endswith("/api/v2/requisitions/"):
response_content = json.dumps(
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
Expand Down
7 changes: 0 additions & 7 deletions www/static/www/bootstrap4/bootstrap.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions www/static/www/bootstrap4/jquery-3.3.1.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions www/static/www/bootstrap4/jquery-3.3.1.slim.min.js

This file was deleted.

2 changes: 1 addition & 1 deletion www/static/www/bootstrap4/jquery-3.5.1.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion www/static/www/bootstrap4/jquery-3.5.1.slim.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 572d257

Please sign in to comment.