more api tests (mostly triggering execution of some code)
it's hard to test anything without a user / http auth / login / session.
This commit is contained in:
parent
1f28cb3ed0
commit
4c46c30d25
@ -14,5 +14,21 @@ def test_myip(client):
|
|||||||
|
|
||||||
|
|
||||||
def test_nic_update(client):
|
def test_nic_update(client):
|
||||||
response = client.get(reverse('update'))
|
response = client.get(reverse('nic_update'))
|
||||||
assert response.status_code == 401
|
assert response.status_code == 401
|
||||||
|
|
||||||
|
|
||||||
|
def test_nic_update_session(client):
|
||||||
|
response = client.get(reverse('nic_update_authorized'))
|
||||||
|
assert response.status_code == 302 # redirects to login view
|
||||||
|
|
||||||
|
|
||||||
|
def test_detect_ip(client):
|
||||||
|
response = client.get(reverse('detectip', args=('invalid_session_id', )))
|
||||||
|
assert response.status_code == 204
|
||||||
|
|
||||||
|
|
||||||
|
def test_ajax_get_ips(client):
|
||||||
|
response = client.get(reverse('ajax_get_ips'))
|
||||||
|
assert response.status_code == 200
|
||||||
|
|
||||||
|
@ -24,12 +24,12 @@ urlpatterns = patterns(
|
|||||||
url(r'^domain_overview/$', DomainOverwievView.as_view(), name='domain_overview'),
|
url(r'^domain_overview/$', DomainOverwievView.as_view(), name='domain_overview'),
|
||||||
url(r'^domain/(?P<pk>\d+)/delete/$', DeleteDomainView.as_view(), name='delete_domain'),
|
url(r'^domain/(?P<pk>\d+)/delete/$', DeleteDomainView.as_view(), name='delete_domain'),
|
||||||
# internal use by the web ui
|
# internal use by the web ui
|
||||||
url(r'^detectip/(?P<sessionid>\w+)/$', DetectIpView.as_view()),
|
url(r'^detectip/(?P<sessionid>\w+)/$', DetectIpView.as_view(), name='detectip'),
|
||||||
url(r'^ajax_get_ips/$', AjaxGetIps.as_view(), name="ajax_get_ips"),
|
url(r'^ajax_get_ips/$', AjaxGetIps.as_view(), name="ajax_get_ips"),
|
||||||
url(r'^nic/update_authorized$', AuthorizedNicUpdateView.as_view(), name='nic_update_authorized'),
|
url(r'^nic/update_authorized$', AuthorizedNicUpdateView.as_view(), name='nic_update_authorized'),
|
||||||
# api (for update clients)
|
# api (for update clients)
|
||||||
url(r'^myip$', myip_view, name='myip'),
|
url(r'^myip$', myip_view, name='myip'),
|
||||||
url(r'^nic/update$', NicUpdateView.as_view(), name='update'),
|
url(r'^nic/update$', NicUpdateView.as_view(), name='nic_update'),
|
||||||
# for bots
|
# for bots
|
||||||
url(r'^robots.txt$', RobotsTxtView.as_view()),
|
url(r'^robots.txt$', RobotsTxtView.as_view()),
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user