summaryrefslogtreecommitdiff
path: root/tests/modeltests/basic/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/modeltests/basic/tests.py')
-rw-r--r--tests/modeltests/basic/tests.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/modeltests/basic/tests.py b/tests/modeltests/basic/tests.py
index 14d35cc644..fc1f593c13 100644
--- a/tests/modeltests/basic/tests.py
+++ b/tests/modeltests/basic/tests.py
@@ -384,9 +384,9 @@ class ModelTest(TestCase):
try:
Article.objects.all()[0:1] & Article.objects.all()[4:5]
self.fail('Should raise an AssertionError')
- except AssertionError, e:
+ except AssertionError as e:
self.assertEqual(str(e), "Cannot combine queries once a slice has been taken.")
- except Exception, e:
+ except Exception as e:
self.fail('Should raise an AssertionError, not %s' % e)
# Negative slices are not supported, due to database constraints.
@@ -394,15 +394,15 @@ class ModelTest(TestCase):
try:
Article.objects.all()[-1]
self.fail('Should raise an AssertionError')
- except AssertionError, e:
+ except AssertionError as e:
self.assertEqual(str(e), "Negative indexing is not supported.")
- except Exception, e:
+ except Exception as e:
self.fail('Should raise an AssertionError, not %s' % e)
error = None
try:
Article.objects.all()[0:-5]
- except Exception, e:
+ except Exception as e:
error = e
self.assertTrue(isinstance(error, AssertionError))
self.assertEqual(str(error), "Negative indexing is not supported.")