#34327: Test client session does not work as described when using signed cookie engine -------------------------------------+------------------------------------- Reporter: Sergei | Owner: nobody Type: Bug | Status: new Component: Testing | Version: dev framework | Keywords: session Severity: Normal | signed_cookies Triage Stage: | Has patch: 0 Unreviewed | Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | -------------------------------------+------------------------------------- The following snippet from [https://docs.djangoproject.com/en/dev/topics/testing/tools/#django.test.Client.session the documentation] does not work when using `django.contrib.sessions.backends.signed_cookies`:
{{{ #!python def test_something(self): session = self.client.session session['somekey'] = 'test' session.save() }}} `session.save()` is not enough in this case: session key is session data itself and test client cookies need to be updated. Like `session` getter does when creating session store object (`django/test/client.py:732`): {{{ #!python self.cookies[settings.SESSION_COOKIE_NAME] = session.session_key }}} -- Ticket URL: <https://code.djangoproject.com/ticket/34327> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/01070186374efe9b-7d3a193a-b800-4ed1-bdd3-49888b023e91-000000%40eu-central-1.amazonses.com.