Beispiel #1
0
 def test_duplicate_vrf(self):
     vrf = VRF.objects.create(name="Test", rd="1:1", enforce_unique=False)
     Prefix.objects.create(vrf=vrf,
                           prefix=netaddr.IPNetwork("192.0.2.0/24"))
     duplicate_prefix = Prefix(vrf=vrf,
                               prefix=netaddr.IPNetwork("192.0.2.0/24"))
     self.assertIsNone(duplicate_prefix.clean())
Beispiel #2
0
 def test_duplicate_global(self):
     Prefix.objects.create(prefix=netaddr.IPNetwork("192.0.2.0/24"))
     duplicate_prefix = Prefix(prefix=netaddr.IPNetwork("192.0.2.0/24"))
     self.assertIsNone(duplicate_prefix.clean())