Skip to content

Commit

Permalink
Merge c0534d8 into c4f3a61
Browse files Browse the repository at this point in the history
  • Loading branch information
dukebody committed Jun 9, 2017
2 parents c4f3a61 + c0534d8 commit 80d4566
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion defender/test_urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from django.conf.urls import url, include
from django.contrib import admin

from .urls import urlpatterns as original_urlpatterns

urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
]
] + original_urlpatterns
10 changes: 10 additions & 0 deletions defender/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,16 @@ def test_admin(self):
from .admin import AccessAttemptAdmin
AccessAttemptAdmin

def test_unblock_view_user_with_plus(self):
"""
There is an available admin view for unblocking a user
with a plus sign in the username.
Regression test for #GH76.
"""
reverse('defender_unblock_username_view',
kwargs={'username': 'user+test@test.tld'})

def test_decorator_middleware(self):
# because watch_login is called twice in this test (once by the
# middleware and once by the decorator) we have half as many attempts
Expand Down
2 changes: 1 addition & 1 deletion defender/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
name="defender_blocks_view"),
url(r'^blocks/ip/(?P<ip_address>[A-Za-z0-9-._]+)/unblock$', unblock_ip_view,
name="defender_unblock_ip_view"),
url(r'^blocks/username/(?P<username>[A-Za-z0-9-._@]+)/unblock$',
url(r'^blocks/username/(?P<username>[A-Za-z0-9-._@\+]+)/unblock$',
unblock_username_view,
name="defender_unblock_username_view"),
]

0 comments on commit 80d4566

Please sign in to comment.