Image via Wikipedia
I added the built in auth framework to a relatively fresh Django project today, and upon running my tests, I got a large number of failures coming from auth. This problem does not appear to be fully documented so this is what I did.First, notice that most of the errors are template missing errors. Fix these by
- Installing the admin tool. Auth relies on some of its templates.
- Stub out any other missing templates (ie. login, logout).
Finally, some of the password reset tests were complaining about getting redirect (301) codes instead of success (200) codes. This was an error on my part. They're looking for a link in the password reset email and GETting it. I wrapped the link in an HTML anchor, and the regex in the test was grabbing the closing HTML tag. Removing the HTML fixed that problem. Finally, I just had to add some missing text as above, and all the tests passed.