mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #23919 -- Removed six.PY2/PY3 usage
Thanks Tim Graham for the review.
This commit is contained in:
parent
e63d98b7be
commit
c716fe8782
111 changed files with 305 additions and 1296 deletions
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue