def test_allows_multiple_records_unless_cname(self):
dnsdata = factory.make_DNSData(no_ip_addresses=True)
if dnsdata.rrtype == 'CNAME':
with ExpectedException(
ValidationError,
re.escape(
"{'__all__': ['%s']}" % MULTI_CNAME_MSG)):
factory.make_DNSData(
dnsresource=dnsdata.dnsresource,
rrtype='CNAME')
else:
factory.make_DNSData(
dnsresource=dnsdata.dnsresource,
rrtype=dnsdata.rrtype)
self.assertEqual(2, DNSData.objects.filter(
dnsresource=dnsdata.dnsresource).count())
评论列表
文章目录