Skip to content

Commit

Permalink
Tweaked some AutoField tests to not raise wanings in Python>=2.6, w…
Browse files Browse the repository at this point in the history
…here `BaseException.message` has been deprecated.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17045 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
julien committed Oct 28, 2011
1 parent 9c0bc9c commit 4884f7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/modeltests/validation/models.py
Expand Up @@ -102,4 +102,4 @@ class MultipleAutoFields(models.Model):
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."
assert str(assertion_error) == u"A model can't have more than one AutoField."
2 changes: 1 addition & 1 deletion tests/modeltests/validation/test_error_messages.py
Expand Up @@ -17,7 +17,7 @@ def test_autofield_field_raises_error_message(self):
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()
Expand Down

0 comments on commit 4884f7c

Please sign in to comment.