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,25 +1,14 @@
import datetime
from unittest import skipIf
from django.db import models
from django.test import TestCase
from django.test.utils import isolate_apps
from django.utils import six
from .models import Article, InternationalArticle
from .models import InternationalArticle
class SimpleTests(TestCase):
@skipIf(six.PY3, "tests a __str__ method returning unicode under Python 2")
def test_basic(self):
a = Article.objects.create(
headline=b'Parrot programs in Python',
pub_date=datetime.datetime(2005, 7, 28)
)
self.assertEqual(str(a), str('Parrot programs in Python'))
self.assertEqual(repr(a), str('<Article: Parrot programs in Python>'))
def test_international(self):
a = InternationalArticle.objects.create(
headline='Girl wins €12.500 in lottery',