      name = models.CharField(max_length=100, unique=True, error_messages={'unique': u'Custom unique name message.'})
      number = models.IntegerField(unique=True, error_messages={'unique': u'Custom unique number message.'})
  
  class GenericIPAddressTestModel(models.Model):
      generic_ip = models.GenericIPAddressField(blank=True, unique=True)
      v4_ip = models.GenericIPAddressField(blank=True, protocol="ipv4")
      v6_ip = models.GenericIPAddressField(blank=True, protocol="ipv6")
  
  class GenericIPAddrUnpackUniqueTest(models.Model):
      generic_v4unpack_ip = models.GenericIPAddressField(blank=True, unique=True, unpack_ipv4=True)
 
</s> remove         if not value:
            return ''
 </s> add         if value in validators.EMPTY_VALUES:
            return u''
    generic_ip = models.GenericIPAddressField(blank=True, null=True, unique=True)
    v4_ip = models.GenericIPAddressField(blank=True, null=True, protocol="ipv4")
    v6_ip = models.GenericIPAddressField(blank=True, null=True, protocol="ipv6")
      name = models.CharField(max_length=100, unique=True, error_messages={'unique': u'Custom unique name message.'})
      number = models.IntegerField(unique=True, error_messages={'unique': u'Custom unique number message.'})
  
  class GenericIPAddressTestModel(models.Model):
    generic_ip = models.GenericIPAddressField(blank=True, null=True, unique=True)
    v4_ip = models.GenericIPAddressField(blank=True, null=True, protocol="ipv4")
    v6_ip = models.GenericIPAddressField(blank=True, null=True, protocol="ipv6")
    generic_ip = models.GenericIPAddressField(blank=True, null=True, unique=True)
    v4_ip = models.GenericIPAddressField(blank=True, null=True, protocol="ipv4")
    v6_ip = models.GenericIPAddressField(blank=True, null=True, protocol="ipv6")
    generic_ip = models.GenericIPAddressField(blank=True, null=True, unique=True)
    v4_ip = models.GenericIPAddressField(blank=True, null=True, protocol="ipv4")
    v6_ip = models.GenericIPAddressField(blank=True, null=True, protocol="ipv6")
  
  class GenericIPAddrUnpackUniqueTest(models.Model):
      generic_v4unpack_ip = models.GenericIPAddressField(blank=True, unique=True, unpack_ipv4=True)
keep keep keep keep replace replace replace keep keep keep
 Fixed #16246 -- Fixed GenericIPAddressField tests on PostgreSQL.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16395 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
tests/modeltests/validation/models.py