Pull requests

#6 Merged
gowtier gowtier
kmike kmike

Fix custom user authentication handling for django 1.5

  1. Gautier Hayoun

I couldn't find a way to manually log a user in before doing a request so I had to call self.app.get() twice to trigger the issue which is not ideal.

Comments (4)

  1. Mikhail Korobov repo owner

    Thanks, this make sense.

    However, I think tests won't run properly in Python 2.6 because unittest in Python 2.6 doesn't provide skipIf decorator.

    Django 1.3 has unittest2 copy available as django.utils.unittest, but currently django-webtest supports django 1.2; I'm fine with dropping 1.2 support.

  2. Gautier Hayoun author

    Just added the condition as you suggest, seems to work fine.

    I did run the test on django 1.2.7, 1.3, 1.4 and 1.5 but only on Python 2.7 and without the last modification. Let's hope it doesn't break the travis builds.

  3. Mikhail Korobov repo owner

    Thanks! The code fails in Python 3.x because DjangoTestApp._update_environ didn't handle custom users properly (error was silenced in Python 2.x); this is fixed in an extra commit.