@override_settings(ENFORCE_GLOBAL_UNIQUE=True)
def test_duplicate_global_unique(self):
    Prefix.objects.create(prefix=netaddr.IPNetwork('192.0.2.0/24'))
    duplicate_prefix = Prefix(prefix=netaddr.IPNetwork('192.0.2.0/24'))
    self.assertRaises(ValidationError, duplicate_prefix.clean)
@override_settings(ENFORCE_GLOBAL_UNIQUE=True)
def test_duplicate_global_unique(self):
    Prefix.objects.create(prefix=netaddr.IPNetwork('192.0.2.0/24'))
    duplicate_prefix = Prefix(prefix=netaddr.IPNetwork('192.0.2.0/24'))
    self.assertRaises(ValidationError, duplicate_prefix.clean)