From e15f8f6405e1b3751563fd25f36de235286d14b2 Mon Sep 17 00:00:00 2001 From: Bharath Chadarajupalli Date: Mon, 11 Dec 2023 12:48:45 -0800 Subject: [PATCH 1/3] @W-14603959 - Update backend deps and test failure fixes --- config/settings/base.py | 1 + docs/api/schema.yml | 20 ++ metecho/api/models.py | 3 +- metecho/api/tests/admin.py | 2 +- metecho/oauth2/salesforce/tests/provider.py | 20 +- metecho/oauth2/views.py | 2 +- requirements/dev.txt | 210 +++++++++--------- requirements/prod.txt | 228 +++++++++----------- runtime.txt | 2 +- 9 files changed, 244 insertions(+), 244 deletions(-) diff --git a/config/settings/base.py b/config/settings/base.py index 6bb71d261..fea50437d 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -121,6 +121,7 @@ def safe_key() -> str: MIDDLEWARE = [ "metecho.logging_middleware.LoggingMiddleware", "sfdo_template_helpers.admin.middleware.AdminRestrictMiddleware", + "allauth.account.middleware.AccountMiddleware", "django.middleware.security.SecurityMiddleware", "whitenoise.middleware.WhiteNoiseMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", diff --git a/docs/api/schema.yml b/docs/api/schema.yml index 185c6833b..fcb2e6ea6 100644 --- a/docs/api/schema.yml +++ b/docs/api/schema.yml @@ -1871,6 +1871,11 @@ components: - Review - Merged type: string + description: |- + * `Planned` - Planned + * `In progress` - In Progress + * `Review` - Review + * `Merged` - Merged FullUser: type: object properties: @@ -2118,6 +2123,10 @@ components: - QA - Playground type: string + description: |- + * `Dev` - Dev + * `QA` - QA + * `Playground` - Playground PaginatedEpicList: type: object properties: @@ -2481,11 +2490,17 @@ components: - Approved - Changes requested type: string + description: |- + * `Approved` - Approved + * `Changes requested` - Changes Requested RoleEnum: enum: - assigned_qa - assigned_dev type: string + description: |- + * `assigned_qa` - assigned_qa + * `assigned_dev` - assigned_dev ScratchOrg: type: object properties: @@ -2909,6 +2924,11 @@ components: - Completed - Canceled type: string + description: |- + * `Planned` - Planned + * `In progress` - In Progress + * `Completed` - Completed + * `Canceled` - Canceled securitySchemes: cookieAuth: type: apiKey diff --git a/metecho/api/models.py b/metecho/api/models.py index 17b30bf32..4aaac9239 100644 --- a/metecho/api/models.py +++ b/metecho/api/models.py @@ -716,8 +716,9 @@ def __str__(self): return self.name def save(self, *args, **kwargs): + obj = super().save(*args, **kwargs) self.update_status() - return super().save(*args, **kwargs) + return obj def subscribable_by(self, user): # pragma: nocover return True diff --git a/metecho/api/tests/admin.py b/metecho/api/tests/admin.py index 1e9757db6..68e3e4f38 100644 --- a/metecho/api/tests/admin.py +++ b/metecho/api/tests/admin.py @@ -42,7 +42,7 @@ def test_queryset__deleted(self, epic_factory): args = ( None, - {"deleted_at": "true"}, + {"deleted_at": ["true"]}, None, None, ) diff --git a/metecho/oauth2/salesforce/tests/provider.py b/metecho/oauth2/salesforce/tests/provider.py index 47252ee93..5ff2c01cb 100644 --- a/metecho/oauth2/salesforce/tests/provider.py +++ b/metecho/oauth2/salesforce/tests/provider.py @@ -1,14 +1,26 @@ from ..provider import CustomSalesforceProvider +from allauth.socialaccount.models import SocialApp +import pytest +@pytest.fixture +def dummy(): + app = SocialApp.objects.create( + provider=CustomSalesforceProvider.id, + name=CustomSalesforceProvider.id, + client_id="app123id", + key=CustomSalesforceProvider.id, + secret="dummy",) + return app -def test_get_auth_params(rf): +@pytest.mark.django_db +def test_get_auth_params(rf, dummy): request = rf.get("/") - result = CustomSalesforceProvider(request).get_auth_params(request, None) + result = CustomSalesforceProvider(request, dummy).get_auth_params(request, None) assert "prompt" in result and result["prompt"] == "login" - +@pytest.mark.django_db def test_extract_uid(rf): request = rf.get("/") - provider = CustomSalesforceProvider(request) + provider = CustomSalesforceProvider(request, dummy) result = provider.extract_uid({"organization_id": "ORG", "user_id": "USER"}) assert result == "ORG/USER" diff --git a/metecho/oauth2/views.py b/metecho/oauth2/views.py index 6aaf03949..f671cae5f 100644 --- a/metecho/oauth2/views.py +++ b/metecho/oauth2/views.py @@ -19,7 +19,7 @@ def ensure_socialapp_in_db(token): unless we create them here. """ if token.app.pk is None: - provider = providers.registry.by_id(token.app.provider) + provider = providers.registry.get_class(token.app.provider) app, created = SocialApp.objects.get_or_create( provider=provider.id, name=provider.name, diff --git a/requirements/dev.txt b/requirements/dev.txt index 96cd767cb..c33d35b5b 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -4,76 +4,69 @@ # # pip-compile --output-file=requirements/dev.txt requirements/dev.in # -alabaster==0.7.12 +alabaster==0.7.13 # via sphinx -asgiref==3.5.2 +asgiref==3.7.2 # via # -c requirements/prod.txt # daphne # django -asttokens==2.0.5 +asttokens==2.4.1 # via stack-data -attrs==21.4.0 +attrs==23.1.0 # via # -c requirements/prod.txt # automat # flake8-bugbear - # pytest # service-identity # twisted -autobahn==22.6.1 +autobahn==23.6.2 # via # -c requirements/prod.txt # daphne -automat==20.2.0 - # via - # -c requirements/prod.txt - # twisted -babel==2.10.3 +automat==22.10.0 + # via twisted +babel==2.13.1 # via sphinx -backcall==0.2.0 - # via ipython -black==22.6.0 +black==23.11.0 # via -r requirements/dev.in -certifi==2022.12.7 +certifi==2023.7.22 # via # -c requirements/prod.txt # requests -cffi==1.15.1 +cffi==1.16.0 # via # -c requirements/prod.txt # cryptography -charset-normalizer==3.0.1 +charset-normalizer==3.2.0 # via # -c requirements/prod.txt # requests -click==8.1.3 +click==8.1.6 # via # -c requirements/prod.txt # black -constantly==15.1.0 +constantly==23.10.4 + # via twisted +coverage[toml]==7.3.2 # via - # -c requirements/prod.txt - # twisted -coverage[toml]==6.4.2 - # via pytest-cov -cryptography==39.0.1 + # coverage + # pytest-cov +cryptography==41.0.7 # via # -c requirements/prod.txt # autobahn # pyopenssl # service-identity -daphne==3.0.2 - # via - # -c requirements/prod.txt - # -r requirements/dev.in +daphne==4.0.0 + # via -r requirements/dev.in decorator==5.1.1 # via ipython -django==4.0.6 +django==5.0 # via # -c requirements/prod.txt # django-extensions -django-extensions==3.2.0 +django-extensions==3.2.3 # via -r requirements/dev.in doc8==0.11.2 # via -r requirements/dev.in @@ -84,21 +77,25 @@ docutils==0.16 # myst-parser # restructuredtext-lint # sphinx -executing==0.9.0 +exceptiongroup==1.2.0 + # via + # ipython + # pytest +executing==2.0.1 # via stack-data -factory-boy==3.2.1 +factory-boy==3.3.0 # via # -r requirements/dev.in # pytest-factoryboy -faker==17.0.0 +faker==19.3.0 # via # -c requirements/prod.txt # factory-boy -flake8==4.0.1 +flake8==6.1.0 # via # -r requirements/dev.in # flake8-bugbear -flake8-bugbear==22.7.1 +flake8-bugbear==23.12.2 # via -r requirements/dev.in hyperlink==21.0.0 # via @@ -113,110 +110,98 @@ idna==3.4 # twisted imagesize==1.4.1 # via sphinx -incremental==21.3.0 - # via - # -c requirements/prod.txt - # twisted +incremental==22.10.0 + # via twisted inflection==0.5.1 # via # -c requirements/prod.txt # pytest-factoryboy -iniconfig==1.1.1 +iniconfig==2.0.0 # via pytest -ipython==8.4.0 +ipython==8.18.1 # via -r requirements/dev.in -isort==5.10.1 +isort==5.13.1 # via -r requirements/dev.in -jedi==0.18.1 +jedi==0.19.1 # via ipython jinja2==3.1.2 # via # -c requirements/prod.txt # myst-parser # sphinx -markdown-it-py==2.1.0 +markdown-it-py==2.2.0 # via # -c requirements/prod.txt # mdit-py-plugins # myst-parser -markupsafe==2.1.2 +markupsafe==2.1.3 # via # -c requirements/prod.txt # jinja2 -matplotlib-inline==0.1.3 +matplotlib-inline==0.1.6 # via ipython -mccabe==0.6.1 +mccabe==0.7.0 # via flake8 -mdit-py-plugins==0.3.0 +mdit-py-plugins==0.3.5 # via myst-parser mdurl==0.1.2 # via # -c requirements/prod.txt # markdown-it-py -mypy-extensions==0.4.3 +mypy-extensions==1.0.0 # via black -myst-parser==0.18.0 +myst-parser==1.0.0 # via -r requirements/dev.in -packaging==21.3 +packaging==23.2 # via - # -c requirements/prod.txt + # black # pytest # pytest-sugar # sphinx parso==0.8.3 # via jedi -pathspec==0.9.0 +pathspec==0.12.1 # via black -pbr==5.9.0 +pbr==6.0.0 # via stevedore -pexpect==4.8.0 - # via ipython -pickleshare==0.7.5 +pexpect==4.9.0 # via ipython -platformdirs==2.5.2 +platformdirs==4.1.0 # via black -pluggy==1.0.0 +pluggy==1.3.0 # via pytest -prompt-toolkit==3.0.30 +prompt-toolkit==3.0.41 # via ipython ptyprocess==0.7.0 # via pexpect pure-eval==0.2.2 # via stack-data -py==1.11.0 - # via pytest -pyasn1==0.4.8 +pyasn1==0.5.1 # via # -c requirements/prod.txt # pyasn1-modules # service-identity -pyasn1-modules==0.2.8 +pyasn1-modules==0.3.0 # via # -c requirements/prod.txt # service-identity -pycodestyle==2.8.0 +pycodestyle==2.11.1 # via flake8 pycparser==2.21 # via # -c requirements/prod.txt # cffi -pyflakes==2.4.0 +pyflakes==3.1.0 # via flake8 -pygments==2.14.0 +pygments==2.17.2 # via # -c requirements/prod.txt # doc8 # ipython # sphinx -pyopenssl==23.0.0 - # via - # -c requirements/prod.txt - # twisted -pyparsing==3.0.9 - # via - # -c requirements/prod.txt - # packaging -pytest==7.1.2 +pyopenssl==23.3.0 + # via twisted +pytest==7.4.3 # via # -r requirements/dev.in # pytest-asyncio @@ -226,41 +211,37 @@ pytest==7.1.2 # pytest-lazy-fixture # pytest-mock # pytest-sugar -pytest-asyncio==0.19.0 +pytest-asyncio==0.23.2 # via -r requirements/dev.in -pytest-cov==3.0.0 +pytest-cov==4.1.0 # via -r requirements/dev.in -pytest-django==4.5.2 +pytest-django==4.7.0 # via -r requirements/dev.in -pytest-factoryboy==2.5.0 +pytest-factoryboy==2.6.0 # via -r requirements/dev.in pytest-lazy-fixture==0.6.3 # via -r requirements/dev.in -pytest-mock==3.8.2 +pytest-mock==3.12.0 # via -r requirements/dev.in -pytest-sugar==0.9.5 +pytest-sugar==0.9.7 # via -r requirements/dev.in python-dateutil==2.8.2 # via # -c requirements/prod.txt # faker -pytz==2022.7.1 - # via - # -c requirements/prod.txt - # babel -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/prod.txt # myst-parser remote-pdb==2.1.0 # via -r requirements/dev.in -requests==2.28.2 +requests==2.29.0 # via # -c requirements/prod.txt # sphinx restructuredtext-lint==1.4.0 # via doc8 -service-identity==21.1.0 +service-identity==23.1.0 # via # -c requirements/prod.txt # twisted @@ -270,72 +251,75 @@ six==1.16.0 # asttokens # automat # python-dateutil - # service-identity # sphinxcontrib-httpdomain snowballstemmer==2.2.0 # via sphinx -sphinx==5.1.0 +sphinx==5.3.0 # via # -r requirements/dev.in # myst-parser + # sphinxcontrib-applehelp + # sphinxcontrib-devhelp + # sphinxcontrib-htmlhelp # sphinxcontrib-httpdomain -sphinxcontrib-applehelp==1.0.2 + # sphinxcontrib-qthelp + # sphinxcontrib-serializinghtml +sphinxcontrib-applehelp==1.0.7 # via sphinx -sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-devhelp==1.0.5 # via sphinx -sphinxcontrib-htmlhelp==2.0.0 +sphinxcontrib-htmlhelp==2.0.4 # via sphinx -sphinxcontrib-httpdomain==1.8.0 +sphinxcontrib-httpdomain==1.8.1 # via -r requirements/dev.in sphinxcontrib-jsmath==1.0.1 # via sphinx -sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-qthelp==1.0.6 # via sphinx -sphinxcontrib-serializinghtml==1.1.5 +sphinxcontrib-serializinghtml==1.1.9 # via sphinx -sqlparse==0.4.2 +sqlparse==0.4.4 # via # -c requirements/prod.txt # django -stack-data==0.3.0 +stack-data==0.6.3 # via ipython -stevedore==4.0.0 +stevedore==5.1.0 # via doc8 -termcolor==1.1.0 +termcolor==2.4.0 # via pytest-sugar tomli==2.0.1 # via # black # coverage # pytest -traitlets==5.3.0 +traitlets==5.14.0 # via # ipython # matplotlib-inline -twisted[tls]==22.4.0 +twisted[tls]==23.10.0 # via - # -c requirements/prod.txt # daphne -txaio==22.2.1 + # twisted +txaio==23.1.1 # via # -c requirements/prod.txt # autobahn -typing-extensions==4.5.0 +typing-extensions==4.7.1 # via # -c requirements/prod.txt - # myst-parser + # asgiref + # black # pytest-factoryboy # twisted -urllib3==1.26.14 +urllib3==1.26.16 # via # -c requirements/prod.txt # requests -wcwidth==0.2.5 +wcwidth==0.2.12 # via prompt-toolkit -zope-interface==5.4.0 - # via - # -c requirements/prod.txt - # twisted +zope-interface==6.1 + # via twisted # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/requirements/prod.txt b/requirements/prod.txt index 03b6830e5..87f53f26f 100644 --- a/requirements/prod.txt +++ b/requirements/prod.txt @@ -4,100 +4,85 @@ # # pip-compile --output-file=requirements/prod.txt requirements/prod.in # -aioredis==1.3.1 - # via channels-redis appdirs==1.4.4 # via # cumulusci # fs -asgiref==3.5.2 +asgiref==3.7.2 # via # channels # channels-redis - # daphne # django -async-timeout==4.0.2 - # via - # aioredis - # redis -attrs==21.4.0 +async-timeout==4.0.3 + # via redis +attrs==23.1.0 # via - # automat # jsonschema + # referencing # service-identity - # twisted -authlib==1.2.0 +authlib==1.2.1 # via # cumulusci # simple-salesforce -autobahn==22.6.1 - # via - # -r requirements/prod.in - # daphne -automat==20.2.0 - # via twisted -beautifulsoup4==4.11.1 +autobahn==23.6.2 # via -r requirements/prod.in -bleach==5.0.1 +beautifulsoup4==4.12.2 + # via -r requirements/prod.in +bleach==6.1.0 # via # -r requirements/prod.in # sfdo-template-helpers -certifi==2022.12.7 +certifi==2023.7.22 # via # cumulusci # requests # sentry-sdk # snowfakery -cffi==1.15.1 +cffi==1.16.0 # via # cryptography # cumulusci -channels==3.0.5 +channels==4.0.0 # via # -r requirements/prod.in # channels-redis -channels-redis==3.4.1 +channels-redis==4.1.0 # via -r requirements/prod.in -charset-normalizer==3.0.1 +charset-normalizer==3.2.0 # via # cumulusci # requests # snowfakery -click==8.1.3 +click==8.1.6 # via # cumulusci # rq # snowfakery -constantly==15.1.0 - # via twisted -croniter==1.3.5 +crontab==1.0.1 # via rq-scheduler -cryptography==39.0.1 +cryptography==41.0.7 # via # authlib # autobahn # cumulusci + # django-anymail # pyjwt - # pyopenssl # secretstorage # service-identity # sfdo-template-helpers -cumulusci==3.76.0 +cumulusci==3.83.0 # via -r requirements/prod.in -daphne==3.0.2 - # via channels defusedxml==0.7.1 # via # cumulusci # python3-openid -deprecated==1.2.13 - # via redis -dj-database-url==0.5.0 +dj-database-url==2.1.0 # via -r requirements/prod.in -django==4.0.6 +django==5.0 # via # -r requirements/prod.in # channels + # dj-database-url # django-allauth # django-anymail # django-filter @@ -110,51 +95,62 @@ django==4.0.6 # djangorestframework # drf-spectacular # sfdo-template-helpers -django-allauth==0.51.0 +django-allauth==0.58.2 # via -r requirements/prod.in -django-anymail[mailgun]==8.6 +django-anymail[mailgun]==10.2 # via -r requirements/prod.in -django-environ==0.9.0 +django-environ==0.11.2 # via -r requirements/prod.in -django-filter==22.1 +django-filter==23.5 # via sfdo-template-helpers -django-hashid-field==3.3.5 +django-hashid-field==3.3.7 # via -r requirements/prod.in django-js-reverse @ https://github.com/ierror/django-js-reverse/archive/7cab78c4531780ab4b32033d5104ccd5be1a246a.tar.gz # via -r requirements/prod.in -django-log-request-id==2.0.0 +django-log-request-id==2.1.0 # via -r requirements/prod.in -django-model-utils==4.2.0 +django-model-utils==4.3.1 # via -r requirements/prod.in django-parler==2.3 # via -r requirements/prod.in -django-rq==2.5.1 +django-rq==2.9.0 # via -r requirements/prod.in -djangorestframework==3.13.1 +djangorestframework==3.14.0 # via # -r requirements/prod.in # drf-spectacular # sfdo-template-helpers docutils==0.16 # via cumulusci -drf-spectacular==0.22.1 +drf-spectacular==0.26.5 # via -r requirements/prod.in -faker==17.0.0 +faker==19.3.0 # via # cumulusci + # faker-edu + # faker-nonprofit # snowfakery +faker-edu==1.0.0 + # via + # cumulusci + # snowfakery +faker-nonprofit==1.0.0 + # via + # cumulusci + # snowfakery +freezegun==1.3.1 + # via rq-scheduler fs==2.4.16 # via cumulusci furl==2.1.3 # via -r requirements/prod.in -github3-py==3.2.0 +github3-py==4.0.1 # via # -r requirements/prod.in # cumulusci -greenlet==2.0.2 +greenlet==3.0.1 # via # cumulusci - # snowfakery # sqlalchemy gvgen==1.0 # via @@ -162,27 +158,20 @@ gvgen==1.0 # snowfakery hashids==1.3.1 # via django-hashid-field -hiredis==2.0.0 - # via aioredis honcho==1.1.0 # via -r requirements/prod.in hyperlink==21.0.0 - # via - # autobahn - # twisted + # via autobahn idna==3.4 # via # cumulusci # hyperlink # requests # snowfakery - # twisted -importlib-metadata==6.0.0 +importlib-metadata==6.8.0 # via # cumulusci # keyring -incremental==21.3.0 - # via twisted inflection==0.5.1 # via drf-spectacular jeepney==0.8.0 @@ -194,25 +183,27 @@ jinja2==3.1.2 # via # cumulusci # snowfakery -jsonschema==4.7.2 +jsonschema==4.20.0 # via drf-spectacular +jsonschema-specifications==2023.11.2 + # via jsonschema keyring==23.0.1 # via cumulusci logfmt==0.4 # via # -r requirements/prod.in # sfdo-template-helpers -lxml==4.9.2 +lxml==4.9.3 # via cumulusci -markdown==3.4.1 +markdown==3.5.1 # via # -r requirements/prod.in # sfdo-template-helpers -markdown-it-py==2.1.0 +markdown-it-py==2.2.0 # via # cumulusci # rich -markupsafe==2.1.2 +markupsafe==2.1.3 # via # cumulusci # jinja2 @@ -221,80 +212,78 @@ mdurl==0.1.2 # via # cumulusci # markdown-it-py -msgpack==1.0.4 +msgpack==1.0.7 # via channels-redis -natsort==8.2.0 +natsort==8.4.0 # via # cumulusci # robotframework-pabot -oauthlib==3.2.0 +oauthlib==3.2.2 # via requests-oauthlib orderedmultidict==1.0.1 # via furl -packaging==21.3 - # via redis -psutil==5.9.4 +psutil==5.9.6 # via cumulusci -psycopg2-binary==2.9.3 +psycopg2-binary==2.9.9 # via -r requirements/prod.in -pyasn1==0.4.8 +pyasn1==0.5.1 # via # pyasn1-modules # service-identity -pyasn1-modules==0.2.8 +pyasn1-modules==0.3.0 # via service-identity pycparser==2.21 # via # cffi # cumulusci -pydantic==1.10.5 +pydantic==1.10.12 # via # cumulusci # snowfakery -pygments==2.14.0 +pygments==2.17.2 # via # cumulusci # rich -pyjwt[crypto]==2.6.0 +pyjwt[crypto]==2.8.0 # via # cumulusci # django-allauth # github3-py -pyopenssl==23.0.0 - # via twisted -pyparsing==3.0.9 - # via packaging -pyrsistent==0.18.1 - # via jsonschema + # pyjwt python-baseconv==1.2.2 # via # cumulusci # snowfakery python-dateutil==2.8.2 # via - # croniter # cumulusci # faker + # freezegun # github3-py # rq-scheduler # snowfakery python3-openid==3.2.0 # via django-allauth -pytz==2022.7.1 +pytz==2023.3.post1 # via # cumulusci # djangorestframework -pyyaml==6.0 +pyyaml==6.0.1 # via # -r requirements/prod.in # cumulusci # drf-spectacular # snowfakery -redis==4.3.4 +redis==5.0.1 # via + # channels-redis # django-rq # rq -requests==2.28.2 +referencing==0.32.0 + # via + # jsonschema + # jsonschema-specifications +requests==2.29.0 # via # cumulusci # django-allauth @@ -306,29 +295,26 @@ requests==2.28.2 # salesforce-bulk # simple-salesforce # snowfakery -requests-futures==1.0.0 +requests-futures==1.0.1 # via cumulusci requests-oauthlib==1.3.1 # via django-allauth -rich==13.3.1 +rich==13.7.0 # via cumulusci -robotframework==6.0.2 +robotframework==6.1.1 # via # cumulusci - # robotframework-lint # robotframework-pabot # robotframework-requests # robotframework-seleniumlibrary # robotframework-stacktrace -robotframework-lint==1.1 +robotframework-pabot==2.16.0 # via cumulusci -robotframework-pabot==2.13.0 - # via cumulusci -robotframework-pythonlibcore==4.1.0 +robotframework-pythonlibcore==4.3.0 # via # cumulusci # robotframework-seleniumlibrary -robotframework-requests==0.9.4 +robotframework-requests==0.9.6 # via cumulusci robotframework-seleniumlibrary==5.1.3 # via cumulusci @@ -336,11 +322,15 @@ robotframework-stacktrace==0.4.1 # via # cumulusci # robotframework-pabot -rq==1.10.1 +rpds-py==0.13.2 + # via + # jsonschema + # referencing +rq==1.15.1 # via # django-rq # rq-scheduler -rq-scheduler==0.11.0 +rq-scheduler==0.13.1 # via -r requirements/prod.in rst2ansi==0.1.5 # via cumulusci @@ -356,12 +346,10 @@ selenium==3.141.0 # via # cumulusci # robotframework-seleniumlibrary -sentry-sdk==1.8.0 +sentry-sdk==1.38.0 + # via -r requirements/prod.in +service-identity==23.1.0 # via -r requirements/prod.in -service-identity==21.1.0 - # via - # -r requirements/prod.in - # twisted sfdo-template-helpers @ https://github.com/SFDO-Tooling/sfdo-template-helpers/archive/v0.20.0.tar.gz # via -r requirements/prod.in simple-salesforce==1.11.4 @@ -370,7 +358,6 @@ simple-salesforce==1.11.4 # salesforce-bulk six==1.16.0 # via - # automat # bleach # cumulusci # fs @@ -378,28 +365,26 @@ six==1.16.0 # orderedmultidict # python-dateutil # salesforce-bulk - # service-identity # snowfakery -snowfakery==3.5.0 +snowfakery==3.6.1 # via cumulusci -soupsieve==2.3.2.post1 +soupsieve==2.5 # via beautifulsoup4 -sqlalchemy==1.4.46 +sqlalchemy==1.4.49 # via # cumulusci # snowfakery -sqlparse==0.4.2 +sqlparse==0.4.4 # via django -twisted[tls]==22.4.0 - # via daphne -txaio==22.2.1 +txaio==23.1.1 # via autobahn -typing-extensions==4.5.0 +typing-extensions==4.7.1 # via + # asgiref # cumulusci + # dj-database-url # pydantic # snowfakery - # twisted unicodecsv==0.14.1 # via # cumulusci @@ -409,27 +394,24 @@ uritemplate==4.1.1 # cumulusci # drf-spectacular # github3-py -urllib3==1.26.14 +urllib3==1.26.16 # via # cumulusci + # django-anymail # requests # selenium # sentry-sdk # snowfakery webencodings==0.5.1 # via bleach -whitenoise==6.2.0 +whitenoise==6.6.0 # via -r requirements/prod.in -wrapt==1.14.1 - # via deprecated xmltodict==0.13.0 # via cumulusci -zipp==3.13.0 +zipp==3.17.0 # via # cumulusci # importlib-metadata -zope-interface==5.4.0 - # via twisted # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/runtime.txt b/runtime.txt index 69b0ccfc8..5fa6f4127 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -python-3.10.8 +python-3.10.13 From 8f0c2e48379bff20f9b220f213cf873fdb405b22 Mon Sep 17 00:00:00 2001 From: Bharath Chadarajupalli Date: Mon, 11 Dec 2023 13:01:39 -0800 Subject: [PATCH 2/3] @W-14603959 - tsc indentation fixes --- metecho/oauth2/salesforce/tests/provider.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/metecho/oauth2/salesforce/tests/provider.py b/metecho/oauth2/salesforce/tests/provider.py index 5ff2c01cb..bd6fe6876 100644 --- a/metecho/oauth2/salesforce/tests/provider.py +++ b/metecho/oauth2/salesforce/tests/provider.py @@ -2,6 +2,7 @@ from allauth.socialaccount.models import SocialApp import pytest + @pytest.fixture def dummy(): app = SocialApp.objects.create( @@ -12,12 +13,14 @@ def dummy(): secret="dummy",) return app + @pytest.mark.django_db def test_get_auth_params(rf, dummy): request = rf.get("/") result = CustomSalesforceProvider(request, dummy).get_auth_params(request, None) assert "prompt" in result and result["prompt"] == "login" + @pytest.mark.django_db def test_extract_uid(rf): request = rf.get("/") From ae6a63b785786e4d356c08fba153d6a4ad28927e Mon Sep 17 00:00:00 2001 From: Bharath Chadarajupalli Date: Fri, 15 Dec 2023 09:54:53 -0800 Subject: [PATCH 3/3] @W-14603959 - moving django back to 4 LTS version and address reiew comments --- metecho/api/models.py | 5 ++-- metecho/api/tests/admin.py | 2 +- metecho/oauth2/salesforce/tests/provider.py | 28 +++++++++------------ requirements/dev.txt | 2 +- requirements/prod.txt | 2 +- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/metecho/api/models.py b/metecho/api/models.py index 4aaac9239..b1928aeda 100644 --- a/metecho/api/models.py +++ b/metecho/api/models.py @@ -716,9 +716,10 @@ def __str__(self): return self.name def save(self, *args, **kwargs): - obj = super().save(*args, **kwargs) + if not self.id: + super().save(*args, **kwargs) self.update_status() - return obj + return super().save() def subscribable_by(self, user): # pragma: nocover return True diff --git a/metecho/api/tests/admin.py b/metecho/api/tests/admin.py index 68e3e4f38..1e9757db6 100644 --- a/metecho/api/tests/admin.py +++ b/metecho/api/tests/admin.py @@ -42,7 +42,7 @@ def test_queryset__deleted(self, epic_factory): args = ( None, - {"deleted_at": ["true"]}, + {"deleted_at": "true"}, None, None, ) diff --git a/metecho/oauth2/salesforce/tests/provider.py b/metecho/oauth2/salesforce/tests/provider.py index bd6fe6876..f9e81d109 100644 --- a/metecho/oauth2/salesforce/tests/provider.py +++ b/metecho/oauth2/salesforce/tests/provider.py @@ -1,29 +1,25 @@ from ..provider import CustomSalesforceProvider -from allauth.socialaccount.models import SocialApp import pytest -@pytest.fixture -def dummy(): - app = SocialApp.objects.create( - provider=CustomSalesforceProvider.id, - name=CustomSalesforceProvider.id, - client_id="app123id", - key=CustomSalesforceProvider.id, - secret="dummy",) - return app - - @pytest.mark.django_db -def test_get_auth_params(rf, dummy): +def test_get_auth_params(rf, social_app_factory): request = rf.get("/") - result = CustomSalesforceProvider(request, dummy).get_auth_params(request, None) + app = social_app_factory( + name=CustomSalesforceProvider.id, + provider=CustomSalesforceProvider.id, + ) + result = CustomSalesforceProvider(request, app).get_auth_params(request, None) assert "prompt" in result and result["prompt"] == "login" @pytest.mark.django_db -def test_extract_uid(rf): +def test_extract_uid(rf, social_app_factory): request = rf.get("/") - provider = CustomSalesforceProvider(request, dummy) + app = social_app_factory( + name=CustomSalesforceProvider.id, + provider=CustomSalesforceProvider.id, + ) + provider = CustomSalesforceProvider(request, app) result = provider.extract_uid({"organization_id": "ORG", "user_id": "USER"}) assert result == "ORG/USER" diff --git a/requirements/dev.txt b/requirements/dev.txt index c33d35b5b..361f30548 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -62,7 +62,7 @@ daphne==4.0.0 # via -r requirements/dev.in decorator==5.1.1 # via ipython -django==5.0 +django~=4.2.0 # via # -c requirements/prod.txt # django-extensions diff --git a/requirements/prod.txt b/requirements/prod.txt index 87f53f26f..9d3ea9b9d 100644 --- a/requirements/prod.txt +++ b/requirements/prod.txt @@ -78,7 +78,7 @@ defusedxml==0.7.1 # python3-openid dj-database-url==2.1.0 # via -r requirements/prod.in -django==5.0 +django~=4.2.0 # via # -r requirements/prod.in # channels