diff options
| author | Ramin Farajpour Cami <ramin.blackhat@gmail.com> | 2016-11-12 20:41:23 +0330 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-11-14 12:30:46 -0500 |
| commit | 967be82443b5640d61608a89897d8ce2bc44fa54 (patch) | |
| tree | 9905e1156e27aa3d1226da3dde1223a5087b0d55 /tests/admin_views | |
| parent | 6072de727f0ffa7bf0aa67aadba5d4589561974d (diff) | |
Fixed E305 flake8 warnings.
Diffstat (limited to 'tests/admin_views')
| -rw-r--r-- | tests/admin_views/admin.py | 12 | ||||
| -rw-r--r-- | tests/admin_views/test_multidb.py | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/admin_views/admin.py b/tests/admin_views/admin.py index 2aa042c386..cdb32a2825 100644 --- a/tests/admin_views/admin.py +++ b/tests/admin_views/admin.py @@ -54,6 +54,8 @@ def callable_year(dt_value): return dt_value.year except AttributeError: return None + + callable_year.admin_order_field = 'date' @@ -252,24 +254,32 @@ def external_mail(modeladmin, request, selected): 'from@example.com', ['to@example.com'] ).send() + + external_mail.short_description = 'External mail (Another awesome action)' def redirect_to(modeladmin, request, selected): from django.http import HttpResponseRedirect return HttpResponseRedirect('/some-where-else/') + + redirect_to.short_description = 'Redirect to (Awesome action)' def download(modeladmin, request, selected): buf = StringIO('This is the content of the file') return StreamingHttpResponse(FileWrapper(buf)) + + download.short_description = 'Download subscription' def no_perm(modeladmin, request, selected): return HttpResponse(content='No permission to perform this action', status=403) + + no_perm.short_description = 'No permission to run' @@ -631,6 +641,8 @@ class AdminOrderedAdminMethodAdmin(admin.ModelAdmin): def admin_ordered_callable(obj): return obj.order + + admin_ordered_callable.admin_order_field = 'order' diff --git a/tests/admin_views/test_multidb.py b/tests/admin_views/test_multidb.py index f5f4d6dc84..102cf35a5d 100644 --- a/tests/admin_views/test_multidb.py +++ b/tests/admin_views/test_multidb.py @@ -16,6 +16,7 @@ class Router(object): db_for_write = db_for_read + site = admin.AdminSite(name='test_adminsite') site.register(Book) |
