mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 18:56:15 +02:00
tests cleanup and formatting for linter
This commit is contained in:
parent
950014ea47
commit
f447df6d64
4 changed files with 165 additions and 78 deletions
|
@ -294,9 +294,8 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def getDnssecdataChanges(
|
def getDnssecdataChanges(
|
||||||
self,
|
self, _dnssecdata: Optional[extensions.DNSSECExtension]
|
||||||
_dnssecdata: Optional[extensions.DNSSECExtension]
|
) -> tuple[dict, dict]:
|
||||||
) -> tuple[dict, dict]:
|
|
||||||
"""
|
"""
|
||||||
calls self.dnssecdata, it should pull from cache but may result
|
calls self.dnssecdata, it should pull from cache but may result
|
||||||
in an epp call
|
in an epp call
|
||||||
|
@ -392,17 +391,17 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
remRequest.add_extension(remExtension)
|
remRequest.add_extension(remExtension)
|
||||||
try:
|
try:
|
||||||
if (
|
if (
|
||||||
"dsData" in _addDnssecdata and
|
"dsData" in _addDnssecdata
|
||||||
_addDnssecdata["dsData"] is not None
|
and _addDnssecdata["dsData"] is not None
|
||||||
or "keyData" in _addDnssecdata and
|
or "keyData" in _addDnssecdata
|
||||||
_addDnssecdata["keyData"] is not None
|
and _addDnssecdata["keyData"] is not None
|
||||||
):
|
):
|
||||||
registry.send(addRequest, cleaned=True)
|
registry.send(addRequest, cleaned=True)
|
||||||
if (
|
if (
|
||||||
"dsData" in _remDnssecdata and
|
"dsData" in _remDnssecdata
|
||||||
_remDnssecdata["dsData"] is not None
|
and _remDnssecdata["dsData"] is not None
|
||||||
or "keyData" in _remDnssecdata and
|
or "keyData" in _remDnssecdata
|
||||||
_remDnssecdata["keyData"] is not None
|
and _remDnssecdata["keyData"] is not None
|
||||||
):
|
):
|
||||||
registry.send(remRequest, cleaned=True)
|
registry.send(remRequest, cleaned=True)
|
||||||
except RegistryError as e:
|
except RegistryError as e:
|
||||||
|
|
|
@ -7,7 +7,7 @@ import random
|
||||||
from string import ascii_uppercase
|
from string import ascii_uppercase
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from unittest.mock import MagicMock, Mock, patch
|
from unittest.mock import MagicMock, Mock, patch
|
||||||
from typing import List, Dict, Mapping, Any
|
from typing import List, Dict
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.auth import get_user_model, login
|
from django.contrib.auth import get_user_model, login
|
||||||
|
@ -704,18 +704,26 @@ class MockEppLib(TestCase):
|
||||||
"alg": 1,
|
"alg": 1,
|
||||||
"pubKey": "AQPJ////4Q==",
|
"pubKey": "AQPJ////4Q==",
|
||||||
}
|
}
|
||||||
dnssecExtensionWithDsData = extensions.DNSSECExtension(**{
|
dnssecExtensionWithDsData = extensions.DNSSECExtension(
|
||||||
"dsData": [common.DSData(**addDsData1)],
|
**{
|
||||||
})
|
"dsData": [
|
||||||
dnssecExtensionWithMultDsData = extensions.DNSSECExtension(**{
|
common.DSData(**addDsData1) # type: ignore
|
||||||
"dsData": [
|
], # type: ignore
|
||||||
common.DSData(**addDsData1), # type: ignore
|
}
|
||||||
common.DSData(**addDsData2), # type: ignore
|
)
|
||||||
],
|
dnssecExtensionWithMultDsData = extensions.DNSSECExtension(
|
||||||
})
|
**{
|
||||||
dnssecExtensionWithKeyData = extensions.DNSSECExtension(**{
|
"dsData": [
|
||||||
"keyData": [common.DNSSECKeyData(**keyDataDict)], # type: ignore
|
common.DSData(**addDsData1), # type: ignore
|
||||||
})
|
common.DSData(**addDsData2), # type: ignore
|
||||||
|
], # type: ignore
|
||||||
|
}
|
||||||
|
)
|
||||||
|
dnssecExtensionWithKeyData = extensions.DNSSECExtension(
|
||||||
|
**{
|
||||||
|
"keyData": [common.DNSSECKeyData(**keyDataDict)], # type: ignore
|
||||||
|
}
|
||||||
|
)
|
||||||
dnssecExtensionRemovingDsData = extensions.DNSSECExtension()
|
dnssecExtensionRemovingDsData = extensions.DNSSECExtension()
|
||||||
|
|
||||||
def mockSend(self, _request, cleaned):
|
def mockSend(self, _request, cleaned):
|
||||||
|
@ -756,35 +764,20 @@ class MockEppLib(TestCase):
|
||||||
if getattr(_request, "name", None) == "security.gov":
|
if getattr(_request, "name", None) == "security.gov":
|
||||||
return MagicMock(res_data=[self.infoDomainNoContact])
|
return MagicMock(res_data=[self.infoDomainNoContact])
|
||||||
elif getattr(_request, "name", None) == "dnssec-dsdata.gov":
|
elif getattr(_request, "name", None) == "dnssec-dsdata.gov":
|
||||||
if self.mockedSendFunction.call_count == 1:
|
return MagicMock(
|
||||||
return MagicMock(res_data=[self.mockDataInfoDomain])
|
res_data=[self.mockDataInfoDomain],
|
||||||
else:
|
extensions=[self.dnssecExtensionWithDsData],
|
||||||
return MagicMock(
|
)
|
||||||
res_data=[self.mockDataInfoDomain],
|
|
||||||
extensions=[
|
|
||||||
self.dnssecExtensionWithDsData
|
|
||||||
],
|
|
||||||
)
|
|
||||||
elif getattr(_request, "name", None) == "dnssec-multdsdata.gov":
|
elif getattr(_request, "name", None) == "dnssec-multdsdata.gov":
|
||||||
if self.mockedSendFunction.call_count == 1:
|
return MagicMock(
|
||||||
return MagicMock(res_data=[self.mockDataInfoDomain])
|
res_data=[self.mockDataInfoDomain],
|
||||||
else:
|
extensions=[self.dnssecExtensionWithMultDsData],
|
||||||
return MagicMock(
|
)
|
||||||
res_data=[self.mockDataInfoDomain],
|
|
||||||
extensions=[
|
|
||||||
self.dnssecExtensionWithMultDsData
|
|
||||||
],
|
|
||||||
)
|
|
||||||
elif getattr(_request, "name", None) == "dnssec-keydata.gov":
|
elif getattr(_request, "name", None) == "dnssec-keydata.gov":
|
||||||
if self.mockedSendFunction.call_count == 1:
|
return MagicMock(
|
||||||
return MagicMock(res_data=[self.mockDataInfoDomain])
|
res_data=[self.mockDataInfoDomain],
|
||||||
else:
|
extensions=[self.dnssecExtensionWithKeyData],
|
||||||
return MagicMock(
|
)
|
||||||
res_data=[self.mockDataInfoDomain],
|
|
||||||
extensions=[
|
|
||||||
self.dnssecExtensionWithKeyData
|
|
||||||
],
|
|
||||||
)
|
|
||||||
elif getattr(_request, "name", None) == "dnssec-none.gov":
|
elif getattr(_request, "name", None) == "dnssec-none.gov":
|
||||||
# this case is not necessary, but helps improve readability
|
# this case is not necessary, but helps improve readability
|
||||||
return MagicMock(res_data=[self.mockDataInfoDomain])
|
return MagicMock(res_data=[self.mockDataInfoDomain])
|
||||||
|
|
|
@ -1034,23 +1034,40 @@ class TestRegistrantDNSSEC(MockEppLib):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# need to use a separate patcher and side_effect for this test, as
|
||||||
|
# response from InfoDomain must be different for different iterations
|
||||||
|
# of the same command
|
||||||
|
def side_effect(_request, cleaned):
|
||||||
|
if isinstance(_request, commands.InfoDomain):
|
||||||
|
if mocked_send.call_count == 1:
|
||||||
|
return MagicMock(res_data=[self.mockDataInfoDomain])
|
||||||
|
else:
|
||||||
|
return MagicMock(
|
||||||
|
res_data=[self.mockDataInfoDomain],
|
||||||
|
extensions=[self.dnssecExtensionWithDsData],
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
return MagicMock(res_data=[self.mockDataInfoHosts])
|
||||||
|
|
||||||
|
patcher = patch("registrar.models.domain.registry.send")
|
||||||
|
mocked_send = patcher.start()
|
||||||
|
mocked_send.side_effect = side_effect
|
||||||
|
|
||||||
domain, _ = Domain.objects.get_or_create(name="dnssec-dsdata.gov")
|
domain, _ = Domain.objects.get_or_create(name="dnssec-dsdata.gov")
|
||||||
domain.dnssecdata = self.dnssecExtensionWithDsData
|
domain.dnssecdata = self.dnssecExtensionWithDsData
|
||||||
|
|
||||||
# get the DNS SEC extension added to the UpdateDomain command and
|
# get the DNS SEC extension added to the UpdateDomain command and
|
||||||
# verify that it is properly sent
|
# verify that it is properly sent
|
||||||
# args[0] is the _request sent to registry
|
# args[0] is the _request sent to registry
|
||||||
args, _ = self.mockedSendFunction.call_args
|
args, _ = mocked_send.call_args
|
||||||
# assert that the extension on the update matches
|
# assert that the extension on the update matches
|
||||||
self.assertEquals(
|
self.assertEquals(
|
||||||
args[0].extensions[0],
|
args[0].extensions[0],
|
||||||
self.createUpdateExtension(
|
self.createUpdateExtension(self.dnssecExtensionWithDsData),
|
||||||
self.dnssecExtensionWithDsData
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
# test that the dnssecdata getter is functioning properly
|
# test that the dnssecdata getter is functioning properly
|
||||||
dnssecdata_get = domain.dnssecdata
|
dnssecdata_get = domain.dnssecdata
|
||||||
self.mockedSendFunction.assert_has_calls(
|
mocked_send.assert_has_calls(
|
||||||
[
|
[
|
||||||
call(
|
call(
|
||||||
commands.InfoDomain(
|
commands.InfoDomain(
|
||||||
|
@ -1077,9 +1094,9 @@ class TestRegistrantDNSSEC(MockEppLib):
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEquals(
|
self.assertEquals(dnssecdata_get.dsData, self.dnssecExtensionWithDsData.dsData)
|
||||||
dnssecdata_get.dsData, self.dnssecExtensionWithDsData.dsData
|
|
||||||
)
|
patcher.stop()
|
||||||
|
|
||||||
def test_dnssec_is_idempotent(self):
|
def test_dnssec_is_idempotent(self):
|
||||||
"""
|
"""
|
||||||
|
@ -1095,9 +1112,28 @@ class TestRegistrantDNSSEC(MockEppLib):
|
||||||
3 - setter causes the getter to call info domain on next get from cache
|
3 - setter causes the getter to call info domain on next get from cache
|
||||||
4 - UpdateDomain command is not called on second setter (no change)
|
4 - UpdateDomain command is not called on second setter (no change)
|
||||||
5 - getter properly parses dnssecdata from InfoDomain response and sets to cache
|
5 - getter properly parses dnssecdata from InfoDomain response and sets to cache
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# need to use a separate patcher and side_effect for this test, as
|
||||||
|
# response from InfoDomain must be different for different iterations
|
||||||
|
# of the same command
|
||||||
|
def side_effect(_request, cleaned):
|
||||||
|
if isinstance(_request, commands.InfoDomain):
|
||||||
|
if mocked_send.call_count == 1:
|
||||||
|
return MagicMock(res_data=[self.mockDataInfoDomain])
|
||||||
|
else:
|
||||||
|
return MagicMock(
|
||||||
|
res_data=[self.mockDataInfoDomain],
|
||||||
|
extensions=[self.dnssecExtensionWithDsData],
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
return MagicMock(res_data=[self.mockDataInfoHosts])
|
||||||
|
|
||||||
|
patcher = patch("registrar.models.domain.registry.send")
|
||||||
|
mocked_send = patcher.start()
|
||||||
|
mocked_send.side_effect = side_effect
|
||||||
|
|
||||||
domain, _ = Domain.objects.get_or_create(name="dnssec-dsdata.gov")
|
domain, _ = Domain.objects.get_or_create(name="dnssec-dsdata.gov")
|
||||||
|
|
||||||
# set the dnssecdata once
|
# set the dnssecdata once
|
||||||
|
@ -1106,7 +1142,7 @@ class TestRegistrantDNSSEC(MockEppLib):
|
||||||
domain.dnssecdata = self.dnssecExtensionWithDsData
|
domain.dnssecdata = self.dnssecExtensionWithDsData
|
||||||
# test that the dnssecdata getter is functioning properly
|
# test that the dnssecdata getter is functioning properly
|
||||||
dnssecdata_get = domain.dnssecdata
|
dnssecdata_get = domain.dnssecdata
|
||||||
self.mockedSendFunction.assert_has_calls(
|
mocked_send.assert_has_calls(
|
||||||
[
|
[
|
||||||
call(
|
call(
|
||||||
commands.InfoDomain(
|
commands.InfoDomain(
|
||||||
|
@ -1139,9 +1175,9 @@ class TestRegistrantDNSSEC(MockEppLib):
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEquals(
|
self.assertEquals(dnssecdata_get.dsData, self.dnssecExtensionWithDsData.dsData)
|
||||||
dnssecdata_get.dsData, self.dnssecExtensionWithDsData.dsData
|
|
||||||
)
|
patcher.stop()
|
||||||
|
|
||||||
def test_user_adds_dnssec_data_multiple_dsdata(self):
|
def test_user_adds_dnssec_data_multiple_dsdata(self):
|
||||||
"""
|
"""
|
||||||
|
@ -1156,23 +1192,40 @@ class TestRegistrantDNSSEC(MockEppLib):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# need to use a separate patcher and side_effect for this test, as
|
||||||
|
# response from InfoDomain must be different for different iterations
|
||||||
|
# of the same command
|
||||||
|
def side_effect(_request, cleaned):
|
||||||
|
if isinstance(_request, commands.InfoDomain):
|
||||||
|
if mocked_send.call_count == 1:
|
||||||
|
return MagicMock(res_data=[self.mockDataInfoDomain])
|
||||||
|
else:
|
||||||
|
return MagicMock(
|
||||||
|
res_data=[self.mockDataInfoDomain],
|
||||||
|
extensions=[self.dnssecExtensionWithMultDsData],
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
return MagicMock(res_data=[self.mockDataInfoHosts])
|
||||||
|
|
||||||
|
patcher = patch("registrar.models.domain.registry.send")
|
||||||
|
mocked_send = patcher.start()
|
||||||
|
mocked_send.side_effect = side_effect
|
||||||
|
|
||||||
domain, _ = Domain.objects.get_or_create(name="dnssec-multdsdata.gov")
|
domain, _ = Domain.objects.get_or_create(name="dnssec-multdsdata.gov")
|
||||||
|
|
||||||
domain.dnssecdata = self.dnssecExtensionWithMultDsData
|
domain.dnssecdata = self.dnssecExtensionWithMultDsData
|
||||||
# get the DNS SEC extension added to the UpdateDomain command
|
# get the DNS SEC extension added to the UpdateDomain command
|
||||||
# and verify that it is properly sent
|
# and verify that it is properly sent
|
||||||
# args[0] is the _request sent to registry
|
# args[0] is the _request sent to registry
|
||||||
args, _ = self.mockedSendFunction.call_args
|
args, _ = mocked_send.call_args
|
||||||
# assert that the extension matches
|
# assert that the extension matches
|
||||||
self.assertEquals(
|
self.assertEquals(
|
||||||
args[0].extensions[0],
|
args[0].extensions[0],
|
||||||
self.createUpdateExtension(
|
self.createUpdateExtension(self.dnssecExtensionWithMultDsData),
|
||||||
self.dnssecExtensionWithMultDsData
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
# test that the dnssecdata getter is functioning properly
|
# test that the dnssecdata getter is functioning properly
|
||||||
dnssecdata_get = domain.dnssecdata
|
dnssecdata_get = domain.dnssecdata
|
||||||
self.mockedSendFunction.assert_has_calls(
|
mocked_send.assert_has_calls(
|
||||||
[
|
[
|
||||||
call(
|
call(
|
||||||
commands.UpdateDomain(
|
commands.UpdateDomain(
|
||||||
|
@ -1197,6 +1250,8 @@ class TestRegistrantDNSSEC(MockEppLib):
|
||||||
dnssecdata_get.dsData, self.dnssecExtensionWithMultDsData.dsData
|
dnssecdata_get.dsData, self.dnssecExtensionWithMultDsData.dsData
|
||||||
)
|
)
|
||||||
|
|
||||||
|
patcher.stop()
|
||||||
|
|
||||||
def test_user_removes_dnssec_data(self):
|
def test_user_removes_dnssec_data(self):
|
||||||
"""
|
"""
|
||||||
Scenario: Registrant removes DNSSEC ds data.
|
Scenario: Registrant removes DNSSEC ds data.
|
||||||
|
@ -1211,6 +1266,25 @@ class TestRegistrantDNSSEC(MockEppLib):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# need to use a separate patcher and side_effect for this test, as
|
||||||
|
# response from InfoDomain must be different for different iterations
|
||||||
|
# of the same command
|
||||||
|
def side_effect(_request, cleaned):
|
||||||
|
if isinstance(_request, commands.InfoDomain):
|
||||||
|
if mocked_send.call_count == 1:
|
||||||
|
return MagicMock(res_data=[self.mockDataInfoDomain])
|
||||||
|
else:
|
||||||
|
return MagicMock(
|
||||||
|
res_data=[self.mockDataInfoDomain],
|
||||||
|
extensions=[self.dnssecExtensionWithDsData],
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
return MagicMock(res_data=[self.mockDataInfoHosts])
|
||||||
|
|
||||||
|
patcher = patch("registrar.models.domain.registry.send")
|
||||||
|
mocked_send = patcher.start()
|
||||||
|
mocked_send.side_effect = side_effect
|
||||||
|
|
||||||
domain, _ = Domain.objects.get_or_create(name="dnssec-dsdata.gov")
|
domain, _ = Domain.objects.get_or_create(name="dnssec-dsdata.gov")
|
||||||
# dnssecdata_get_initial = domain.dnssecdata # call to force initial mock
|
# dnssecdata_get_initial = domain.dnssecdata # call to force initial mock
|
||||||
# domain._invalidate_cache()
|
# domain._invalidate_cache()
|
||||||
|
@ -1219,7 +1293,7 @@ class TestRegistrantDNSSEC(MockEppLib):
|
||||||
# get the DNS SEC extension added to the UpdateDomain command and
|
# get the DNS SEC extension added to the UpdateDomain command and
|
||||||
# verify that it is properly sent
|
# verify that it is properly sent
|
||||||
# args[0] is the _request sent to registry
|
# args[0] is the _request sent to registry
|
||||||
args, _ = self.mockedSendFunction.call_args
|
args, _ = mocked_send.call_args
|
||||||
# assert that the extension on the update matches
|
# assert that the extension on the update matches
|
||||||
self.assertEquals(
|
self.assertEquals(
|
||||||
args[0].extensions[0],
|
args[0].extensions[0],
|
||||||
|
@ -1228,7 +1302,7 @@ class TestRegistrantDNSSEC(MockEppLib):
|
||||||
remove=True,
|
remove=True,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
self.mockedSendFunction.assert_has_calls(
|
mocked_send.assert_has_calls(
|
||||||
[
|
[
|
||||||
call(
|
call(
|
||||||
commands.InfoDomain(
|
commands.InfoDomain(
|
||||||
|
@ -1265,6 +1339,8 @@ class TestRegistrantDNSSEC(MockEppLib):
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
patcher.stop()
|
||||||
|
|
||||||
def test_user_adds_dnssec_keydata(self):
|
def test_user_adds_dnssec_keydata(self):
|
||||||
"""
|
"""
|
||||||
Scenario: Registrant adds DNSSEC key data.
|
Scenario: Registrant adds DNSSEC key data.
|
||||||
|
@ -1278,23 +1354,40 @@ class TestRegistrantDNSSEC(MockEppLib):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# need to use a separate patcher and side_effect for this test, as
|
||||||
|
# response from InfoDomain must be different for different iterations
|
||||||
|
# of the same command
|
||||||
|
def side_effect(_request, cleaned):
|
||||||
|
if isinstance(_request, commands.InfoDomain):
|
||||||
|
if mocked_send.call_count == 1:
|
||||||
|
return MagicMock(res_data=[self.mockDataInfoDomain])
|
||||||
|
else:
|
||||||
|
return MagicMock(
|
||||||
|
res_data=[self.mockDataInfoDomain],
|
||||||
|
extensions=[self.dnssecExtensionWithKeyData],
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
return MagicMock(res_data=[self.mockDataInfoHosts])
|
||||||
|
|
||||||
|
patcher = patch("registrar.models.domain.registry.send")
|
||||||
|
mocked_send = patcher.start()
|
||||||
|
mocked_send.side_effect = side_effect
|
||||||
|
|
||||||
domain, _ = Domain.objects.get_or_create(name="dnssec-keydata.gov")
|
domain, _ = Domain.objects.get_or_create(name="dnssec-keydata.gov")
|
||||||
|
|
||||||
domain.dnssecdata = self.dnssecExtensionWithKeyData
|
domain.dnssecdata = self.dnssecExtensionWithKeyData
|
||||||
# get the DNS SEC extension added to the UpdateDomain command
|
# get the DNS SEC extension added to the UpdateDomain command
|
||||||
# and verify that it is properly sent
|
# and verify that it is properly sent
|
||||||
# args[0] is the _request sent to registry
|
# args[0] is the _request sent to registry
|
||||||
args, _ = self.mockedSendFunction.call_args
|
args, _ = mocked_send.call_args
|
||||||
# assert that the extension matches
|
# assert that the extension matches
|
||||||
self.assertEquals(
|
self.assertEquals(
|
||||||
args[0].extensions[0],
|
args[0].extensions[0],
|
||||||
self.createUpdateExtension(
|
self.createUpdateExtension(self.dnssecExtensionWithKeyData),
|
||||||
self.dnssecExtensionWithKeyData
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
# test that the dnssecdata getter is functioning properly
|
# test that the dnssecdata getter is functioning properly
|
||||||
dnssecdata_get = domain.dnssecdata
|
dnssecdata_get = domain.dnssecdata
|
||||||
self.mockedSendFunction.assert_has_calls(
|
mocked_send.assert_has_calls(
|
||||||
[
|
[
|
||||||
call(
|
call(
|
||||||
commands.UpdateDomain(
|
commands.UpdateDomain(
|
||||||
|
@ -1319,6 +1412,8 @@ class TestRegistrantDNSSEC(MockEppLib):
|
||||||
dnssecdata_get.keyData, self.dnssecExtensionWithKeyData.keyData
|
dnssecdata_get.keyData, self.dnssecExtensionWithKeyData.keyData
|
||||||
)
|
)
|
||||||
|
|
||||||
|
patcher.stop()
|
||||||
|
|
||||||
def test_update_is_unsuccessful(self):
|
def test_update_is_unsuccessful(self):
|
||||||
"""
|
"""
|
||||||
Scenario: An update to the dns data is unsuccessful
|
Scenario: An update to the dns data is unsuccessful
|
||||||
|
|
|
@ -497,7 +497,7 @@ class DomainKeydataView(DomainPermissionView, FormMixin):
|
||||||
}
|
}
|
||||||
if dnssecdata.keyData is None:
|
if dnssecdata.keyData is None:
|
||||||
dnssecdata.keyData = []
|
dnssecdata.keyData = []
|
||||||
dnssecdata["keyData"].append(common.DNSSECKeyData(**keyrecord))
|
dnssecdata.keyData.append(common.DNSSECKeyData(**keyrecord))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
# no server information in this field, skip it
|
# no server information in this field, skip it
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue