add some tests

This commit is contained in:
elnappo 2015-01-02 13:19:51 +01:00
parent d6949e5178
commit a5f0a00e79
2 changed files with 27 additions and 0 deletions

View File

@ -17,7 +17,12 @@ def test_views_anon(client):
for view, kwargs, status_code in [
# stuff that requires being logged-in redirects to the login view:
('account_profile', dict(), 302),
('account_settings', dict(), 302),
('account_delete', dict(), 302),
('registration_disallowed', dict(), 200),
('registration_complete', dict(), 200),
('registration_register', dict(), 200),
('registration_activation_complete', dict(), 200),
]:
print("%s, %s, %s" % (view, kwargs, status_code))
response = client.get(reverse(view, kwargs=kwargs))
@ -28,7 +33,12 @@ def test_views_logged_in(client):
client.login(username=USERNAME, password=PASSWORD)
for view, kwargs, status_code in [
('account_profile', dict(), 200),
('account_settings', dict(), 200),
('account_delete', dict(), 200),
('registration_disallowed', dict(), 200),
('registration_complete', dict(), 200),
('registration_register', dict(), 200),
('registration_activation_complete', dict(), 200),
]:
print("%s, %s, %s" % (view, kwargs, status_code))
response = client.get(reverse(view, kwargs=kwargs))

View File

@ -24,14 +24,19 @@ def test_views_anon(client):
('generate_secret_view', dict(pk=1), 302),
('generate_ns_secret_view', dict(pk=1), 302),
('host_view', dict(pk=1), 302),
('host_view', dict(pk=2), 302),
('host_view', dict(pk=100), 302),
('add_host', dict(), 302),
('delete_host', dict(pk=1), 302),
('related_host_view', dict(mpk=1, pk=1), 302),
('add_related_host', dict(mpk=1), 302),
('delete_related_host', dict(mpk=1, pk=1), 302),
('domain_view', dict(pk=1), 302),
('domain_view', dict(pk=2), 302),
('domain_view', dict(pk=100), 302),
('add_domain', dict(), 302),
('delete_domain', dict(pk=1), 302),
('delete_domain', dict(pk=2), 302),
('updater_hostconfig_overview', dict(pk=1), 302),
('updater_hostconfig', dict(pk=1), 302),
('delete_updater_hostconfig', dict(pk=1), 302),
@ -52,19 +57,31 @@ def test_views_logged_in(client):
('status', dict(), 200),
('overview', dict(), 200),
('generate_secret_view', dict(pk=1), 200),
('generate_secret_view', dict(pk=2), 404),
('generate_secret_view', dict(pk=100), 404),
('generate_ns_secret_view', dict(pk=1), 200),
('generate_ns_secret_view', dict(pk=2), 404),
('host_view', dict(pk=1), 200),
('host_view', dict(pk=2), 404),
('host_view', dict(pk=100), 404),
('add_host', dict(), 200),
('delete_host', dict(pk=1), 200),
('delete_host', dict(pk=2), 404),
('related_host_view', dict(mpk=1, pk=1), 200),
('add_related_host', dict(mpk=1), 200),
('delete_related_host', dict(mpk=1, pk=1), 200),
('domain_view', dict(pk=1), 200),
('domain_view', dict(pk=2), 404),
('domain_view', dict(pk=100), 404),
('add_domain', dict(), 200),
('delete_domain', dict(pk=1), 200),
('delete_domain', dict(pk=2), 404),
('updater_hostconfig_overview', dict(pk=1), 200),
('updater_hostconfig_overview', dict(pk=2), 404),
('updater_hostconfig', dict(pk=1), 200),
('updater_hostconfig', dict(pk=2), 404),
('delete_updater_hostconfig', dict(pk=1), 200),
('delete_updater_hostconfig', dict(pk=2), 404),
('update', dict(), 401),
]:
print("%s, %s, %s" % (view, kwargs, status_code))