2013-10-03 21:52:35 +02:00
|
|
|
"""
|
|
|
|
Tests for api package.
|
|
|
|
"""
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2013-11-15 12:14:36 +01:00
|
|
|
from django.core.urlresolvers import reverse
|
|
|
|
|
2013-10-03 21:52:35 +02:00
|
|
|
|
|
|
|
def test_myip(client):
|
2013-11-15 12:14:36 +01:00
|
|
|
response = client.get(reverse('myip'))
|
2013-10-03 21:52:35 +02:00
|
|
|
assert response.status_code == 200
|
|
|
|
assert response.content in ['127.0.0.1', '::1']
|
|
|
|
|
|
|
|
|
|
|
|
def test_nic_update(client):
|
2013-11-15 12:14:36 +01:00
|
|
|
response = client.get(reverse('update'))
|
2013-10-03 21:52:35 +02:00
|
|
|
assert response.status_code == 401
|