From 56dbe924a6e700cefbfd34f1a5aa6c1ee01478dc Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Fri, 20 Jul 2012 12:45:19 +0200 Subject: [py3] Removed longs. --- tests/modeltests/basic/tests.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'tests/modeltests/basic') diff --git a/tests/modeltests/basic/tests.py b/tests/modeltests/basic/tests.py index 3f00fb25fe..d96c60bbe8 100644 --- a/tests/modeltests/basic/tests.py +++ b/tests/modeltests/basic/tests.py @@ -5,6 +5,7 @@ from datetime import datetime from django.core.exceptions import ObjectDoesNotExist from django.db.models.fields import Field, FieldDoesNotExist from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature +from django.utils.six import PY3 from django.utils.translation import ugettext_lazy from .models import Article @@ -321,17 +322,18 @@ class ModelTest(TestCase): ["", ""]) - # Slicing works with longs. - self.assertEqual(Article.objects.all()[0L], a) - self.assertQuerysetEqual(Article.objects.all()[1L:3L], - ["", ""]) - self.assertQuerysetEqual((s1 | s2 | s3)[::2L], - ["", - ""]) - - # And can be mixed with ints. - self.assertQuerysetEqual(Article.objects.all()[1:3L], - ["", ""]) + # Slicing works with longs (Python 2 only -- Python 3 doesn't have longs). + if not PY3: + self.assertEqual(Article.objects.all()[long(0)], a) + self.assertQuerysetEqual(Article.objects.all()[long(1):long(3)], + ["", ""]) + self.assertQuerysetEqual((s1 | s2 | s3)[::long(2)], + ["", + ""]) + + # And can be mixed with ints. + self.assertQuerysetEqual(Article.objects.all()[1:long(3)], + ["", ""]) # Slices (without step) are lazy: self.assertQuerysetEqual(Article.objects.all()[0:5].filter(), -- cgit v1.3