@override_settings(ENFORCE_GLOBAL_UNIQUE=True)
def test_duplicate_global_unique(self):
    IPAddress.objects.create(address=netaddr.IPNetwork('192.0.2.1/24'))
    duplicate_ip = IPAddress(address=netaddr.IPNetwork('192.0.2.1/24'))
    self.assertRaises(ValidationError, duplicate_ip.clean)
@override_settings(ENFORCE_GLOBAL_UNIQUE=True)
def test_duplicate_global_unique(self):
    IPAddress.objects.create(address=netaddr.IPNetwork('192.0.2.1/24'))
    duplicate_ip = IPAddress(address=netaddr.IPNetwork('192.0.2.1/24'))
    self.assertRaises(ValidationError, duplicate_ip.clean)