mozilla / django-browserid

Django application for adding BrowserID support.
Mozilla Public License 2.0
179 stars 80 forks source link

Simplify CSRF and Tests #289

Closed Osmose closed 9 years ago

Osmose commented 9 years ago

This PR does two things:

  1. Reduces our set of tested/supported Python and Django versions to Django 1.7 and 1.8 and their supported Python versions. Since 1.8 is the new LTS release we don't need to support 1.4 anymore, and our support of other unsupported Django versions was just holding us back.

    As a part of this, I removed django-nose (as we weren't really using any of it's features) and refactored runtests.py to match a bit better the testing script that Django suggests. I left nose in because we use some of its helpers and I didn't feel like renaming and reformatting our tests to remove it.

  2. Simplify the CSRF view to just check for the two variations of CSRF tokens we care about instead of doing some magic around pulling the token out of the request context. I ran into issues with the existing code while working on Pontoon, which uses django-jinja, which got me looking at it in the first place.
Osmose commented 9 years ago

@willkg r?

willkg commented 9 years ago

This looks good to me as far as I can tell.