本文整理汇总了Python中mozdns.address_record.models.AddressRecord.domain方法的典型用法代码示例。如果您正苦于以下问题:Python AddressRecord.domain方法的具体用法?Python AddressRecord.domain怎么用?Python AddressRecord.domain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mozdns.address_record.models.AddressRecord
的用法示例。
在下文中一共展示了AddressRecord.domain方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_no_update_when_glue
# 需要导入模块: from mozdns.address_record.models import AddressRecord [as 别名]
# 或者: from mozdns.address_record.models.AddressRecord import domain [as 别名]
def test_no_update_when_glue(self):
"""A record shouldn't update it's label or domain when it is a glue
record"""
label = 'ns99'
glue = AddressRecord(label=label, domain=self.o_e,
ip_str='128.193.1.10', ip_type='4')
glue.save()
server = "%s.%s" % (label, self.o_e)
ns = Nameserver(domain=self.o_e, server=server)
ns.save()
self.assertTrue(ns.glue == glue)
# Shouldn't be able to edit label or domain.
glue.label = "ns100"
self.assertRaises(ValidationError, glue.save)
glue.domain = self.m_o_e
self.assertRaises(ValidationError, glue.save)
glue = AddressRecord.objects.get(pk=glue.pk)
glue.label = "ns101"
glue.domain = self.e
self.assertRaises(ValidationError, glue.save)
# Ip can change.
glue = AddressRecord.objects.get(pk=glue.pk)
glue.ip_str = "192.192.12.12"
glue.save()