test more main views, exclude csrf failure view from coverage

This commit is contained in:
Thomas Waldmann 2013-12-18 03:50:41 +01:00
parent 3d53d8f1fd
commit b718b93453
2 changed files with 7 additions and 1 deletions

View File

@ -25,6 +25,9 @@ def test_views_anon(client):
('generate_ns_secret_view', dict(pk=1), 302),
('delete_host', dict(pk=1), 302),
('delete_domain', dict(pk=1), 302),
('updater_hostconfig_overview', dict(pk=1), 302),
('updater_hostconfig', dict(pk=1), 302),
('delete_updater_hostconfig', dict(pk=1), 302),
# interactive updater shows http basic auth popup
('update', dict(), 401),
]:
@ -49,6 +52,9 @@ def test_views_logged_in(client):
('generate_ns_secret_view', dict(pk=1), 200),
('delete_host', dict(pk=1), 200),
('delete_domain', dict(pk=1), 200),
('updater_hostconfig_overview', dict(pk=1), 200),
('updater_hostconfig', dict(pk=1), 200),
('delete_updater_hostconfig', dict(pk=1), 200),
('update', dict(), 401),
]:
print view, kwargs, status_code

View File

@ -458,7 +458,7 @@ Disallow: /updater_hostconfig_overview/
return HttpResponse(content, content_type="text/plain")
def csrf_failure_view(request, reason):
def csrf_failure_view(request, reason): # pragma: no cover (hard to test)
"""
Django's CSRF middleware's builtin view doesn't tell the user that he needs to have cookies enabled.