From 46cc530fad3c6ae4009557121971fe749742aef6 Mon Sep 17 00:00:00 2001 From: Alex Gaynor <alex.gaynor@gmail.com> Date: Tue, 7 Aug 2012 07:22:25 -0700 Subject: [PATCH] Fix a test that relied on an exception outliving the `except` block, which doesn't happen on py3k. --- tests/modeltests/validation/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/modeltests/validation/models.py b/tests/modeltests/validation/models.py index 0adc9fec32..26fff4b863 100644 --- a/tests/modeltests/validation/models.py +++ b/tests/modeltests/validation/models.py @@ -101,6 +101,6 @@ try: class MultipleAutoFields(models.Model): auto1 = models.AutoField(primary_key=True) auto2 = models.AutoField(primary_key=True) -except AssertionError as assertion_error: - pass # Fail silently +except AssertionError as exc: + assertion_error = exc assert str(assertion_error) == "A model can't have more than one AutoField."