Fix a test that relied on an exception outliving the `except` block, which doesn't happen on py3k.

This commit is contained in:
Alex Gaynor 2012-08-07 07:22:25 -07:00
parent bf4da7a442
commit 46cc530fad
1 changed files with 2 additions and 2 deletions

View File

@ -101,6 +101,6 @@ try:
class MultipleAutoFields(models.Model): class MultipleAutoFields(models.Model):
auto1 = models.AutoField(primary_key=True) auto1 = models.AutoField(primary_key=True)
auto2 = models.AutoField(primary_key=True) auto2 = models.AutoField(primary_key=True)
except AssertionError as assertion_error: except AssertionError as exc:
pass # Fail silently assertion_error = exc
assert str(assertion_error) == "A model can't have more than one AutoField." assert str(assertion_error) == "A model can't have more than one AutoField."