diff options
author | django-bot <ops@djangoproject.com> | 2022-02-03 20:24:19 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-07 20:37:05 +0100 |
commit | 9c19aff7c7561e3a82978a272ecdaad40dda5c00 (patch) | |
tree | f0506b668a013d0063e5fba3dbf4863b466713ba /tests/str | |
parent | f68fa8b45dfac545cfc4111d4e52804c86db68d3 (diff) | |
download | django-9c19aff7c7561e3a82978a272ecdaad40dda5c00.tar.gz |
Refs #33476 -- Reformatted code with Black.
Diffstat (limited to 'tests/str')
-rw-r--r-- | tests/str/tests.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/str/tests.py b/tests/str/tests.py index 181906fa0d..6213af63cd 100644 --- a/tests/str/tests.py +++ b/tests/str/tests.py @@ -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)>") |