Commit b8711496 authored by Julien Phalip's avatar Julien Phalip
Browse files

Tweaked some `AutoField` tests to not raise wanings in Python>=2.6, where...

Tweaked some `AutoField` tests to not raise wanings in Python>=2.6, where `BaseException.message` has been deprecated.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17045 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent a693bbe0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -102,4 +102,4 @@ try:
        auto2 = models.AutoField(primary_key=True)
except AssertionError, assertion_error:
    pass # Fail silently
assert assertion_error.message == u"A model can't have more than one AutoField."
 No newline at end of file
assert str(assertion_error) == u"A model can't have more than one AutoField."
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ class ValidationMessagesTest(TestCase):
        try:
            models.AutoField(primary_key=False)
        except AssertionError, e:
            self.assertEqual(e.message, u"AutoFields must have primary_key=True.")
            self.assertEqual(str(e), "AutoFields must have primary_key=True.")

    def test_integer_field_raises_error_message(self):
        f = models.IntegerField()