1. Mikhail Korobov
  2. django-webtest
  3. Issues
Issue #22 new

self.app.get with empty user after existing user

Vladimir Khramov
created an issue

When i trying get some page with existing user and than anonymous user, second request don't work with anonymous user:

self.app.get('/page', user='quantum') # in view request.user=quantum
self.app.get('/page') # in view request.user also = quantum

because in DjangoTestApp.get we have line:

extra_environ = self._update_environ(extra_environ, user)

which don't modify extra_environ when user=None

Is it bug? Or wrong usecase of self.app.get? PS I know, than self.renew_app() between gets can help me

Comments (2)

  1. Mikhail Korobov repo owner


    This is by design - self.app is stateful, and using 'user' argument is not very different from logging in via 'login' view. Do you have ideas about a better way to deal with this?

  2. Log in to comment