本文整理汇总了Python中mozdns.address_record.models.AddressRecord.delete方法的典型用法代码示例。如果您正苦于以下问题:Python AddressRecord.delete方法的具体用法?Python AddressRecord.delete怎么用?Python AddressRecord.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mozdns.address_record.models.AddressRecord
的用法示例。
在下文中一共展示了AddressRecord.delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: do_remove_AAAA_record
# 需要导入模块: from mozdns.address_record.models import AddressRecord [as 别名]
# 或者: from mozdns.address_record.models.AddressRecord import delete [as 别名]
def do_remove_AAAA_record(self, aname, domain, ip):
aret = AddressRecord(
label=aname, domain=domain, ip_str=ip, ip_type='6')
aret.save()
self.assertTrue(aret)
aret.delete()
nret = AddressRecord.objects.filter(
label=aname, domain=domain, ip_str=ip)
self.assertFalse(nret)
示例2: test_delete_with_cname_pointing_to_a
# 需要导入模块: from mozdns.address_record.models import AddressRecord [as 别名]
# 或者: from mozdns.address_record.models.AddressRecord import delete [as 别名]
def test_delete_with_cname_pointing_to_a(self):
label = 'foo100'
a = AddressRecord(label=label, domain=self.o_e, ip_str=
'128.193.1.10', ip_type='4')
a.clean()
a.save()
cn = CNAME(label="foomom", domain=self.o_e, target=label + "." +
self.o_e.name)
cn.clean()
cn.save()
self.assertRaises(ValidationError, a.delete)
a.delete(check_cname=False)
示例3: test_cleanup_address
# 需要导入模块: from mozdns.address_record.models import AddressRecord [as 别名]
# 或者: from mozdns.address_record.models.AddressRecord import delete [as 别名]
def test_cleanup_address(self):
self.assertFalse(Domain.objects.filter(name="x.y.z.foo.poo"))
self.assertFalse(Domain.objects.filter(name="y.z.foo.poo"))
self.assertFalse(Domain.objects.filter(name="z.foo.poo"))
self.assertTrue(Domain.objects.filter(name="foo.poo"))
fqdn = "bar.x.y.z.foo.poo"
label, the_domain = ensure_label_domain(fqdn)
addr = AddressRecord(label=label, domain=the_domain,
ip_type='4', ip_str="10.2.3.4")
addr.save()
self.assertFalse(prune_tree(the_domain))
addr.delete()
self.assertFalse(Domain.objects.filter(name="x.y.z.foo.poo"))
self.assertFalse(Domain.objects.filter(name="y.z.foo.poo"))
self.assertFalse(Domain.objects.filter(name="z.foo.poo"))
self.assertTrue(Domain.objects.filter(name="foo.poo"))
示例4: test_basic_add_remove5
# 需要导入模块: from mozdns.address_record.models import AddressRecord [as 别名]
# 或者: from mozdns.address_record.models.AddressRecord import delete [as 别名]
def test_basic_add_remove5(self):
# Make sure all record types block
f_c = create_fake_zone("foo.foo22", suffix="")
self.assertFalse(f_c.purgeable)
fqdn = "bar.x.y.z.foo.foo22"
label, the_domain = ensure_label_domain(fqdn)
txt = TXT(label=label, domain=the_domain, txt_data="Nthing")
txt.save()
self.assertFalse(prune_tree(the_domain))
txt.delete()
label, the_domain = ensure_label_domain(fqdn)
addr = AddressRecord(label=label, domain=the_domain,
ip_type='4', ip_str="10.2.3.4")
addr.save()
self.assertFalse(prune_tree(the_domain))
addr.delete()
label, the_domain = ensure_label_domain(fqdn)
mx = MX(label=label, domain=the_domain, server="foo", priority=4)
mx.save()
self.assertFalse(prune_tree(the_domain))
mx.delete()
label, the_domain = ensure_label_domain(fqdn)
ns = Nameserver(domain=the_domain, server="asdfasffoo")
ns.save()
self.assertFalse(prune_tree(the_domain))
ns.delete()
label, the_domain = ensure_label_domain(fqdn)
srv = SRV(
label='_' + label, domain=the_domain, target="foo", priority=4,
weight=4, port=34)
srv.save()
self.assertFalse(prune_tree(the_domain))
srv.delete()