django22: Django now truncates using the ellipsis character

As seen here [1]. One wonders if we're coupling ourselves rather tightly
to Django internals.

[1] https://github.com/django/django/commit/201017df308

Change-Id: Ifdcdc540f6027c05eadec6445543842f8cc00e2b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2019-08-26 15:37:35 +01:00
parent 493c95459d
commit fbcfdf5f86

View File

@ -18,6 +18,7 @@
import unittest import unittest
import uuid import uuid
import django
from django import forms from django import forms
from django import http from django import http
from django import shortcuts from django import shortcuts
@ -668,8 +669,12 @@ class DataTableTests(test.TestCase):
row = self.table.get_rows()[0] row = self.table.get_rows()[0]
self.assertEqual(35, len(row.cells['status'].data)) self.assertEqual(35, len(row.cells['status'].data))
self.assertEqual(u'A Status that is longer than 35 ...', if django.VERSION >= (2, 2):
row.cells['status'].data) self.assertEqual(u'A Status that is longer than 35 ch…',
row.cells['status'].data)
else:
self.assertEqual(u'A Status that is longer than 35 ...',
row.cells['status'].data)
def test_table_rendering(self): def test_table_rendering(self):
self.table = MyTable(self.request, TEST_DATA) self.table = MyTable(self.request, TEST_DATA)