mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Refs #23919 -- Removed support for broken Model.__str__() in Model.__repr__().
Returning invalid bytestrings in __str__() is unlikely in Python 3.
This commit is contained in:
@@ -8,8 +8,8 @@ from django.test import TestCase, skipUnlessDBFeature
|
||||
from django.utils.timezone import get_fixed_timezone
|
||||
|
||||
from .models import (
|
||||
Article, BrokenStrMethod, Department, Event, Model1, Model2, Model3,
|
||||
NonAutoPK, Party, Worker,
|
||||
Article, Department, Event, Model1, Model2, Model3, NonAutoPK, Party,
|
||||
Worker,
|
||||
)
|
||||
|
||||
|
||||
@@ -186,11 +186,6 @@ class ModelTests(TestCase):
|
||||
w = Worker.objects.create(department=d, name="Full-time")
|
||||
self.assertEqual(str(w), "Full-time")
|
||||
|
||||
def test_broken_unicode(self):
|
||||
# Models with broken __str__() methods have a printable repr().
|
||||
b = BrokenStrMethod.objects.create(name='Jerry')
|
||||
self.assertEqual(repr(b), '<BrokenStrMethod: [Bad Unicode data]>')
|
||||
|
||||
@skipUnlessDBFeature("supports_timezones")
|
||||
def test_timezones(self):
|
||||
# Saving an updating with timezone-aware datetime Python objects.
|
||||
|
||||
Reference in New Issue
Block a user