mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Refs #33476 -- Reformatted code with Black.
This commit is contained in:
committed by
Mariusz Felisiak
parent
f68fa8b45d
commit
9c19aff7c7
@@ -8,20 +8,20 @@ from .models import InternationalArticle
|
||||
|
||||
|
||||
class SimpleTests(TestCase):
|
||||
|
||||
def test_international(self):
|
||||
a = InternationalArticle.objects.create(
|
||||
headline='Girl wins €12.500 in lottery',
|
||||
pub_date=datetime.datetime(2005, 7, 28)
|
||||
headline="Girl wins €12.500 in lottery",
|
||||
pub_date=datetime.datetime(2005, 7, 28),
|
||||
)
|
||||
self.assertEqual(str(a), 'Girl wins €12.500 in lottery')
|
||||
self.assertEqual(str(a), "Girl wins €12.500 in lottery")
|
||||
|
||||
@isolate_apps('str')
|
||||
@isolate_apps("str")
|
||||
def test_defaults(self):
|
||||
"""
|
||||
The default implementation of __str__ and __repr__ should return
|
||||
instances of str.
|
||||
"""
|
||||
|
||||
class Default(models.Model):
|
||||
pass
|
||||
|
||||
@@ -30,8 +30,8 @@ class SimpleTests(TestCase):
|
||||
# coerce the returned value.
|
||||
self.assertIsInstance(obj.__str__(), str)
|
||||
self.assertIsInstance(obj.__repr__(), str)
|
||||
self.assertEqual(str(obj), 'Default object (None)')
|
||||
self.assertEqual(repr(obj), '<Default: Default object (None)>')
|
||||
self.assertEqual(str(obj), "Default object (None)")
|
||||
self.assertEqual(repr(obj), "<Default: Default object (None)>")
|
||||
obj2 = Default(pk=100)
|
||||
self.assertEqual(str(obj2), 'Default object (100)')
|
||||
self.assertEqual(repr(obj2), '<Default: Default object (100)>')
|
||||
self.assertEqual(str(obj2), "Default object (100)")
|
||||
self.assertEqual(repr(obj2), "<Default: Default object (100)>")
|
||||
|
||||
Reference in New Issue
Block a user