1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #23919 -- Removed six.PY2/PY3 usage

Thanks Tim Graham for the review.
This commit is contained in:
Claude Paroz
2016-12-01 11:38:01 +01:00
parent e63d98b7be
commit c716fe8782
111 changed files with 305 additions and 1296 deletions

View File

@@ -1,13 +1,12 @@
import datetime
import unittest
from decimal import Decimal
from django.db.models.fields import (
AutoField, BigIntegerField, BinaryField, BooleanField, CharField,
DateField, DateTimeField, DecimalField, EmailField, FilePathField,
FloatField, GenericIPAddressField, IntegerField, IPAddressField,
NullBooleanField, PositiveIntegerField, PositiveSmallIntegerField,
SlugField, SmallIntegerField, TextField, TimeField, URLField,
AutoField, BinaryField, BooleanField, CharField, DateField, DateTimeField,
DecimalField, EmailField, FilePathField, FloatField, GenericIPAddressField,
IntegerField, IPAddressField, NullBooleanField, PositiveIntegerField,
PositiveSmallIntegerField, SlugField, SmallIntegerField, TextField,
TimeField, URLField,
)
from django.db.models.fields.files import FileField, ImageField
from django.test import SimpleTestCase
@@ -21,11 +20,6 @@ class PromiseTest(SimpleTestCase):
lazy_func = lazy(lambda: 1, int)
self.assertIsInstance(AutoField(primary_key=True).get_prep_value(lazy_func()), int)
@unittest.skipIf(six.PY3, 'Python 3 has no `long` type.')
def test_BigIntegerField(self):
lazy_func = lazy(lambda: long(9999999999999999999), long) # NOQA: long undefined on PY3
self.assertIsInstance(BigIntegerField().get_prep_value(lazy_func()), long) # NOQA
def test_BinaryField(self):
lazy_func = lazy(lambda: b'', bytes)
self.assertIsInstance(BinaryField().get_prep_value(lazy_func()), bytes)