소스 검색

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

Alex Gaynor 12 년 전
부모
커밋
46cc530fad
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      tests/modeltests/validation/models.py

+ 2 - 2
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."