fix broken api test

as we first check for a nochg update, we couldn't always get the expected dnserr here as the dns update is tried after the  nochg check.
so, if the address did not change, the test failed. fixed by making sure it is not a nochg update.
This commit is contained in:
Thomas Waldmann 2014-08-27 16:45:05 +02:00
parent a89d6353a8
commit 56bddb83b6

View File

@ -83,7 +83,12 @@ def test_nic_update_authorized_ns_unavailable(client):
d = Domain.objects.get(domain=TESTDOMAIN)
d.available = False # simulate DNS unavailability
d.save()
response = client.get(reverse('nic_update'),
# prepare: we must make sure the real test is not a nochg update
response = client.get(reverse('nic_update') + '?myip=1.2.3.4',
HTTP_AUTHORIZATION=make_basic_auth_header(TEST_HOST, TEST_SECRET))
assert response.status_code == 200
# now do the real test: ip changed, but we can't update DNS as it is unavailable
response = client.get(reverse('nic_update') + '?myip=4.3.2.1',
HTTP_AUTHORIZATION=make_basic_auth_header(TEST_HOST, TEST_SECRET))
assert response.status_code == 200
assert response.content == b'dnserr'