Permalink
Browse files

fix nits

  • Loading branch information...
1 parent 7db4703 commit f1253f8ff19267e9c326e3cc91e013b5fba2058e @graingert committed May 10, 2013
Showing with 15 additions and 14 deletions.
  1. +4 −4 .travis.yml
  2. +3 −5 django_browserid/auth.py
  3. +4 −1 django_browserid/forms.py
  4. +2 −2 django_browserid/tests/test_auth.py
  5. +1 −1 requirements.txt
  6. +1 −1 setup.py
View
@@ -5,17 +5,17 @@ python:
env:
- DJANGO_VERSION=1.3.7
- DJANGO_VERSION=1.4.5
- - DJANGO_VERSION=1.5
+ - DJANGO_VERSION=1.5.1
matrix:
include:
- python: 3.2
- env: DJANGO_VERSION=1.5
+ env: DJANGO_VERSION=1.5.1
- python: 3.3
- env: DJANGO_VERSION=1.5
+ env: DJANGO_VERSION=1.5.1
allow_failures:
- python: 3.2
install:
- pip install -e git+git://github.com/sobotklp/django-nose@b3f485e914965e0a7b7012c309864d6a6dcac3ed#egg=django-nose
- - pip install -e git+git://github.com/django/django.git@${DJANGO_VERSION}#egg=django
+ - pip install django==${DJANGO_VERSION}
- pip install -r requirements.txt --use-mirrors
script: python setup.py test
View
@@ -32,11 +32,9 @@ def default_username_algo(email):
# store the username as a base64 encoded sha1 of the email address
# this protects against data leakage because usernames are often
# treated as public identifiers (so we can't use the email address).
- username = base64.urlsafe_b64encode(
- hashlib.sha1(
- smart_bytes(email)
- ).digest()).rstrip(b'=')
- return username
+ return base64.urlsafe_b64encode(
+ hashlib.sha1(smart_bytes(email)).digest()
+ ).rstrip(b'=')
class BrowserIDBackend(object):
@@ -23,7 +23,10 @@ class Media:
def clean_assertion(self):
try:
- return smart_bytes(self.cleaned_data['assertion'], encoding='ascii')
+ return smart_bytes(
+ self.cleaned_data['assertion'],
+ encoding='ascii'
+ )
except UnicodeEncodeError:
# not ascii :(
raise forms.ValidationError('non-ascii string')
@@ -100,8 +100,8 @@ def test_verify_called_with_browserid_extra(self, user_verify):
if get_user_model:
-# Only run custom user model tests if we're using a version of Django that
-# supports it.
+ # Only run custom user model tests if we're using a version of Django that
+ # supports it.
@patch.object(settings, 'AUTH_USER_MODEL', 'tests.CustomUser')
class CustomUserModelTests(TestCase):
def _auth(self, backend=None, verified_email=None):
View
@@ -4,7 +4,7 @@ fancy_tag==0.2.0
# Tests
mock>=0.8.0
Django>=1.3
-django-nose
+-e git+git://github.com/sobotklp/django-nose@b3f485e914965e0a7b7012c309864d6a6dcac3ed#egg=django-nose
pyquery==1.2.4
# Documentation
View
@@ -5,7 +5,7 @@
def read(*parts):
- return codecs.open(os.path.join(os.path.dirname(__file__), *parts), encoding="utf8").read()
+ return codecs.open(os.path.join(os.path.dirname(__file__), *parts), encoding='utf8').read()
def find_version(*file_paths):

0 comments on commit f1253f8

Please sign in to comment.