tests: fix broken tests after django-webtest upgrade (#67724)

This commit is contained in:
Agate 2022-07-27 15:44:42 +02:00 committed by Frédéric Péters
parent 0fa62c1598
commit f95a39744d
2 changed files with 12 additions and 2 deletions

View File

@ -112,3 +112,13 @@ USER_PROFILE_CONFIG = {
LEGACY_URLS_MAPPING = {'old.org': 'new.org'}
PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]
REST_FRAMEWORK = {
# this is the default value but by explicitely setting it
# we avoid a collision with django-webtest erasing the setting
# while patching it
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.BasicAuthentication',
]
}

View File

@ -2021,7 +2021,7 @@ def test_email_from_basket(app, regie, remote_invoices_httmock):
# **Behaviours of PayView**
# Logout
app.set_user()
app.set_user(None)
app.session.flush()
# email is mandatory for paying a remote invoice without being authenticated
@ -2063,7 +2063,7 @@ def test_email_from_basket(app, regie, remote_invoices_httmock):
regie.save()
# Logout
app.set_user()
app.set_user(None)
app.session.flush()
# Get a response to extract csrf_token