adding nic api tests
This commit is contained in:
parent
2dfc9707ca
commit
9428ed7943
0
nsupdate/api/_tests/__init__.py
Normal file
0
nsupdate/api/_tests/__init__.py
Normal file
21
nsupdate/api/_tests/test_api.py
Normal file
21
nsupdate/api/_tests/test_api.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
"""
|
||||||
|
Tests for api package.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
# TODO XXX experiencing ImportErrors all the time. somehow project package structure is borked.
|
||||||
|
# what is the usual, working, project structure for a testable django / pytest.django project?
|
||||||
|
|
||||||
|
pytest.skip("doesn't work due to ImportErrors....")
|
||||||
|
|
||||||
|
|
||||||
|
def test_myip(client):
|
||||||
|
response = client.get('/myip')
|
||||||
|
assert response.status_code == 200
|
||||||
|
assert response.content in ['127.0.0.1', '::1']
|
||||||
|
|
||||||
|
|
||||||
|
def test_nic_update(client):
|
||||||
|
response = client.get('/nic/update')
|
||||||
|
assert response.status_code == 401
|
Loading…
x
Reference in New Issue
Block a user