Skip to content

Commit

Permalink
fix broken api test
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ThomasWaldmann committed Aug 27, 2014
1 parent a89d635 commit 56bddb8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nsupdate/api/_tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 56bddb8

Please sign in to comment.