Open je-bugshell opened 9 months ago
Hi,
django-webtest is supposed to handle sessions just fine. see https://github.com/django-webtest/django-webtest/blob/6370c1afe034da416b03b2f88b7c71b9a49122c6/django_webtest_tests/testapp_tests/tests.py#L466
provide at least your INSTALLED_APPS / MIDDLEWARE. The session stuff need to be before the allauth stuff
also provide a traceback. even if it's simple for you to reproduce the problem, I'm not sure I'll have time for that.
Even better, add a test in a PR to reproduce the problem, if possible
Thanks
I've opened a PR https://github.com/django-webtest/django-webtest/pull/131 that demonstrates this bug.
django-allauth just introduced a userssessions app. They added a check for a request.session.session_key in their model manager which assumes that
session_key
exists. But writing a simple test like this breaks it. (the second self.app.get() raises aValueError()
because thesession_key
is missing):To be clear, this issue is not specific to
django-allauth
, but was discovered due to this new feature.This issue can replicated by adding django-allauth's new usersessions app, include
'django.contrib.sessions',
in theINSTALLED_APPS
and'django.contrib.sessions.middleware.SessionMiddleware',
and'allauth.usersessions.middleware.UserSessionsMiddleware'
to the middlewares.