Skip to content

Commit

Permalink
Add index so str.format works on python 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
pydanny committed Aug 10, 2013
1 parent 1e437ea commit e0688fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions djstripe/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
if hasattr(User, 'USERNAME_FIELD'):
# Using a Django 1.5 User model
user_search_fields = [
"customer__user__{}".format(User.USERNAME_FIELD)
"customer__user__{0}".format(User.USERNAME_FIELD)
]

try:
Expand Down Expand Up @@ -215,7 +215,7 @@ def customer_user(obj):
# In Django 1.5+ a User is not guaranteed to have an email field
email = getattr(obj, 'email', '')

return "{} <{}>".format(
return "{0} <{1}>".format(
username,
email
)
Expand Down
10 changes: 8 additions & 2 deletions tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,18 @@ def test_is_staff(self):
response = self.spm.process_request(request)
self.assertEqual(response, None)

def test_appname_exempt(self):
def test_appname(self):
request = Request(self.user, "/admin/")
response = self.spm.process_request(request)
self.assertEqual(response, None)

def test_namespace_exempt(self):
def test_namespace(self):
request = Request(self.user, "/djstripe/")
response = self.spm.process_request(request)
self.assertEqual(response, None)

def test_namespace_and_url(self):
pass

def test_url(self):
pass

0 comments on commit e0688fa

Please sign in to comment.