Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made an `AutoField` test more robust.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16992 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit d3cd9c0d0675e5067562a21b5341223ebd157761 1 parent 93a5814
@jphalip jphalip authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 tests/modeltests/validation/models.py
View
10 tests/modeltests/validation/models.py
@@ -93,11 +93,13 @@ class GenericIPAddrUnpackUniqueTest(models.Model):
generic_v4unpack_ip = models.GenericIPAddressField(blank=True, unique=True, unpack_ipv4=True)
+# A model can't have multiple AutoFields
+# Refs #12467.
+assertion_error = None
try:
- # A model can't have multiple AutoFields
- # Refs #12467.
class MultipleAutoFields(models.Model):
auto1 = models.AutoField(primary_key=True)
auto2 = models.AutoField(primary_key=True)
-except AssertionError, e:
- assert e.message == u"A model can't have more than one AutoField."
+except AssertionError, assertion_error:
+ pass # Fail silently
+assert assertion_error.message == u"A model can't have more than one AutoField."
Please sign in to comment.
Something went wrong with that request. Please try again.