Pull requests

#6 Merged
Repository
gowtier gowtier
Branch
default
Repository
kmike kmike
Branch
default

Fix custom user authentication handling for django 1.5

Author
  1. Gautier Hayoun avatarGautier Hayoun
Reviewers
Description

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.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.