def test__no_save_range_within_ranges(self):
subnet = make_plain_subnet()
IPRange(
subnet=subnet,
type=IPRANGE_TYPE.DYNAMIC,
start_ip="192.168.0.100",
end_ip="192.168.0.150",
).save()
# Make a contained range, should not save.
iprange = IPRange(
subnet=subnet,
type=IPRANGE_TYPE.DYNAMIC,
start_ip="192.168.0.110",
end_ip="192.168.0.140",
)
with ExpectedException(ValidationError, self.dynamic_overlaps):
iprange.save()
评论列表
文章目录