Page MenuHomeSoftware Heritage
Paste P974

(An Untitled Masterwork)
ActivePublic

Authored by ardumont on Mar 12 2021, 4:10 PM.
tox -e py3-django2-dev -- -s -k test_backend_
GLOB sdist-make: /home/tony/work/inria/repo/swh/swh-environment/swh-deposit/setup.py
py3-django2-dev inst-nodeps: /home/tony/work/inria/repo/swh/swh-environment/swh-deposit/.tox/.tmp/package/1/swh.deposit-0.11.2.dev3+gf42e3dfe.d20210312.zip
py3-django2-dev installed: aiohttp==3.7.4.post0,aiohttp-utils==3.1.1,amqp==5.0.5,async-timeout==3.0.1,attrs==20.3.0,attrs-strict==0.2.1,beautifulsoup4==4.9.3,billiard==3.6.3.0,blinker==1.4,cassandra-driver==3.24.0,celery==5.0.5,certifi==2020.12.5,cffi==1.14.5,chardet==4.0.0,click==7.1.2,click-didyoumean==0.0.3,click-plugins==1.1.1,click-repl==0.1.6,confluent-kafka==1.6.0,coreapi==2.3.3,coreschema==0.0.4,coverage==5.5,cryptography==3.4.6,decorator==4.4.2,Deprecated==1.2.11,distro==1.5.0,Django==2.2.19,django-stubs==1.7.0,django-test-migrations==1.1.0,djangorestframework==3.12.2,djangorestframework-stubs==1.4.0,ecdsa==0.14.1,elasticsearch==7.11.0,fancycompleter==0.9.1,Flask==1.1.2,geomet==0.2.1.post1,gunicorn==20.0.4,httplib2==0.19.0,humanize==3.2.0,hypothesis==6.8.0,idna==2.10,importlib-metadata==3.7.2,iniconfig==1.1.1,iso8601==0.1.14,itsdangerous==1.1.0,itypes==1.2.0,jeepney==0.6.0,Jinja2==2.11.3,keyring==23.0.0,kombu==5.0.2,launchpadlib==1.10.13,lazr.restfulclient==0.14.3,lazr.uri==1.0.5,MarkupSafe==1.1.1,mirakuru==2.3.0,msgpack==1.0.2,multidict==5.1.0,mypy==0.812,mypy-extensions==0.4.3,oauthlib==3.1.0,packaging==20.9,pbr==5.5.1,pdbpp==0.10.2,pika==1.2.0,pkginfo==1.7.0,plotille==3.7.2,pluggy==0.13.1,port-for==0.4,prompt-toolkit==3.0.17,psutil==5.8.0,psycopg2==2.8.6,py==1.10.0,pyasn1==0.4.8,pycparser==2.20,Pygments==2.8.1,pyparsing==2.4.7,pyrepl==0.9.0,pytest==6.2.2,pytest-cov==2.11.1,pytest-django==4.1.0,pytest-mock==3.5.1,pytest-postgresql==2.6.1,python-dateutil==2.8.1,python-debian==0.1.39,python-jose==3.2.0,python-keycloak==0.24.0,python-mimeparse==1.6.0,pytz==2021.1,PyYAML==5.4.1,requests==2.25.1,requests-mock==1.8.0,rsa==4.7.2,SecretStorage==3.3.1,sentry-sdk==1.0.0,simpy==3.0.13,six==1.15.0,sortedcontainers==2.3.0,soupsieve==2.2,sqlparse==0.4.1,swh.auth @ file:///home/tony/work/inria/repo/swh/swh-environment/swh-auth,swh.core==0.12.0,swh.deposit @ file:///home/tony/work/inria/repo/swh/swh-environment/swh-deposit/.tox/.tmp/package/1/swh.deposit-0.11.2.dev3%2Bgf42e3dfe.d20210312.zip,swh.journal==0.7.1,swh.lister==0.10.0,swh.loader.core==0.20.0,swh.model==2.1.0,swh.objstorage==0.2.2,swh.scheduler==0.10.0,swh.storage==0.24.1,tenacity==7.0.0,testresources==2.0.1,toml==0.10.2,typed-ast==1.4.2,typing-extensions==3.7.4.3,uritemplate==3.0.1,urllib3==1.26.3,vine==5.0.0,wadllib==1.3.5,wcwidth==0.2.5,Werkzeug==1.0.1,wmctrl==0.3,wrapt==1.12.1,xmltodict==0.12.0,yarl==1.6.3,zipp==3.4.1
py3-django2-dev run-test-pre: PYTHONHASHSEED='3082583648'
py3-django2-dev run-test: commands[0] | pytest /home/tony/work/inria/repo/swh/swh-environment/swh-deposit/.tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit -s -k test_backend_
============================================================================================================= test session starts =============================================================================================================
platform linux -- Python 3.7.3, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
cachedir: .tox/py3-django2-dev/.pytest_cache
django: settings: swh.deposit.settings.testing (from ini)
rootdir: /home/tony/work/inria/repo/swh/swh-environment/swh-deposit, configfile: pytest.ini
plugins: mock-3.5.1, hypothesis-6.8.0, django-4.1.0, django-test-migrations-1.1.0, requests-mock-1.8.0, cov-2.11.1, swh.journal-0.7.1, postgresql-2.6.1
collected 249 items / 245 deselected / 4 selected
.tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit/tests/test_backend.py create_plpgsql_language
----------------------------
language already installed
(1 row)
..FF
================================================================================================================== FAILURES ===================================================================================================================
_______________________________________________________________________________________________________ test_backend_authentication_ok ________________________________________________________________________________________________________
self = <django.apps.registry.Apps object at 0x7fd28c7f45c0>, app_label = ''
def get_app_config(self, app_label):
"""
Import applications and returns an app config for the given label.
Raise LookupError if no application exists with this label.
"""
self.check_apps_ready()
try:
> return self.app_configs[app_label]
E KeyError: ''
.tox/py3-django2-dev/lib/python3.7/site-packages/django/apps/registry.py:155: KeyError
During handling of the above exception, another exception occurred:
backend_success = <swh.deposit.auth.KeycloakBasicAuthentication object at 0x7fd2898ccd68>
deposit_user = <DepositClient: {'id': 2, 'collections': [2], 'username': 'test', 'domain': 'archives-ouvertes.fr/', 'provider_url': 'https://hal-test.archives-ouvertes.fr/'}>
def test_backend_authentication_ok(backend_success, deposit_user):
"""Keycloak configured ok, backend db configured ok, user logs in
"""
user0, _ = backend_success.authenticate_credentials(
deposit_user.username, PASSWORD, REQUEST_OBJECT
)
assert user0 is not None
# A second authentication call should leverage the django cache feature.
user1, _ = backend_success.authenticate_credentials(
> deposit_user.username, PASSWORD, REQUEST_OBJECT
)
.tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit/tests/test_backend.py:67:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit/auth.py:130: in authenticate_credentials
deposit_client = cache.get(f"deposit_client_{user_id}")
.tox/py3-django2-dev/lib/python3.7/site-packages/django/core/cache/backends/locmem.py:44: in get
return pickle.loads(pickled)
.tox/py3-django2-dev/lib/python3.7/site-packages/django/db/models/base.py:1828: in model_unpickle
model = apps.get_model(*model_id)
.tox/py3-django2-dev/lib/python3.7/site-packages/django/apps/registry.py:205: in get_model
app_config = self.get_app_config(app_label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.apps.registry.Apps object at 0x7fd28c7f45c0>, app_label = ''
def get_app_config(self, app_label):
"""
Import applications and returns an app config for the given label.
Raise LookupError if no application exists with this label.
"""
self.check_apps_ready()
try:
return self.app_configs[app_label]
except KeyError:
message = "No installed app with label '%s'." % app_label
for app_config in self.get_app_configs():
if app_config.name == app_label:
message += " Did you mean '%s'?" % app_config.label
break
> raise LookupError(message)
E LookupError: No installed app with label ''.
.tox/py3-django2-dev/lib/python3.7/site-packages/django/apps/registry.py:162: LookupError
_____________________________________________________________________________________________________ test_backend_authentication_refused _____________________________________________________________________________________________________
self = <django.apps.registry.Apps object at 0x7fd28c7f45c0>, app_label = ''
def get_app_config(self, app_label):
"""
Import applications and returns an app config for the given label.
Raise LookupError if no application exists with this label.
"""
self.check_apps_ready()
try:
> return self.app_configs[app_label]
E KeyError: ''
.tox/py3-django2-dev/lib/python3.7/site-packages/django/apps/registry.py:155: KeyError
During handling of the above exception, another exception occurred:
backend_failure = <swh.deposit.auth.KeycloakBasicAuthentication object at 0x7fd2899187f0>
def test_backend_authentication_refused(backend_failure):
with pytest.raises(AuthenticationFailed):
backend_failure.authenticate_credentials(
> TEST_USER["username"], PASSWORD, REQUEST_OBJECT
)
.tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit/tests/test_backend.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit/auth.py:130: in authenticate_credentials
deposit_client = cache.get(f"deposit_client_{user_id}")
.tox/py3-django2-dev/lib/python3.7/site-packages/django/core/cache/backends/locmem.py:44: in get
return pickle.loads(pickled)
.tox/py3-django2-dev/lib/python3.7/site-packages/django/db/models/base.py:1828: in model_unpickle
model = apps.get_model(*model_id)
.tox/py3-django2-dev/lib/python3.7/site-packages/django/apps/registry.py:205: in get_model
app_config = self.get_app_config(app_label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.apps.registry.Apps object at 0x7fd28c7f45c0>, app_label = ''
def get_app_config(self, app_label):
"""
Import applications and returns an app config for the given label.
Raise LookupError if no application exists with this label.
"""
self.check_apps_ready()
try:
return self.app_configs[app_label]
except KeyError:
message = "No installed app with label '%s'." % app_label
for app_config in self.get_app_configs():
if app_config.name == app_label:
message += " Did you mean '%s'?" % app_config.label
break
> raise LookupError(message)
E LookupError: No installed app with label ''.
.tox/py3-django2-dev/lib/python3.7/site-packages/django/apps/registry.py:162: LookupError
============================================================================================================== warnings summary ===============================================================================================================
.tox/py3-django2-dev/lib/python3.7/site-packages/jose/backends/cryptography_backend.py:18
/home/tony/work/inria/repo/swh/swh-environment/swh-deposit/.tox/py3-django2-dev/lib/python3.7/site-packages/jose/backends/cryptography_backend.py:18: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
from cryptography.utils import int_from_bytes, int_to_bytes
.tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit/tests/test_backend.py::test_backend_authentication_db_misconfigured
.tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit/tests/test_backend.py::test_backend_authentication_db_misconfigured
.tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit/tests/test_backend.py::test_backend_authentication_user_inactive
.tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit/tests/test_backend.py::test_backend_authentication_user_inactive
.tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit/tests/test_backend.py::test_backend_authentication_ok
.tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit/tests/test_backend.py::test_backend_authentication_ok
.tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit/tests/test_backend.py::test_backend_authentication_refused
.tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit/tests/test_backend.py::test_backend_authentication_refused
/home/tony/work/inria/repo/swh/swh-environment/swh-deposit/.tox/py3-django2-dev/lib/python3.7/site-packages/urllib3/util/retry.py:591: DeprecationWarning: Using 'method_whitelist' with Retry is deprecated and will be removed in v2.0. Use 'allowed_methods' instead
DeprecationWarning,
-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================================================================================================== short test summary info ===========================================================================================================
FAILED .tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit/tests/test_backend.py::test_backend_authentication_ok - LookupError: No installed app with label ''.
FAILED .tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit/tests/test_backend.py::test_backend_authentication_refused - LookupError: No installed app with label ''.
=========================================================================================== 2 failed, 2 passed, 245 deselected, 9 warnings in 2.66s ===========================================================================================
ERROR: InvocationError for command /home/tony/work/inria/repo/swh/swh-environment/swh-deposit/.tox/py3-django2-dev/bin/pytest .tox/py3-django2-dev/lib/python3.7/site-packages/swh/deposit -s -k test_backend_ (exited with code 1)
___________________________________________________________________________________________________________________ summary ___________________________________________________________________________________________________________________
ERROR: py3-django2-dev: commands failed