From 26b41b4e9f97d2c07430511d11d8960b7d6fee1d Mon Sep 17 00:00:00 2001 From: fredkingham Date: Mon, 1 Apr 2019 17:44:06 +0100 Subject: [PATCH] Lookup lists are no longer displaying the name in the admin, this changes it to use the pre-python 3 behaviour --- opal/core/lookuplists.py | 2 +- opal/tests/test_lookuplists.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opal/core/lookuplists.py b/opal/core/lookuplists.py index 7b7164f2d..2bac13359 100644 --- a/opal/core/lookuplists.py +++ b/opal/core/lookuplists.py @@ -124,7 +124,7 @@ class Meta: abstract = True unique_together = ('code', 'system') - def __unicode__(self): + def __str__(self): return self.name def to_dict(self, user): diff --git a/opal/tests/test_lookuplists.py b/opal/tests/test_lookuplists.py index 69b65a974..c1ca74a5e 100644 --- a/opal/tests/test_lookuplists.py +++ b/opal/tests/test_lookuplists.py @@ -152,8 +152,8 @@ def test_create_instance_allow_no_symptom(self): class LookupListClassTestCase(AbstractLookupListTestCase): - def test_unicode(self): - self.assertEqual(self.hat.__unicode__(), u"Cowboy") + def test_str(self): + self.assertEqual(self.hat.__str__(), u"Cowboy") def test_to_dict(self): self.assertEqual(self.hat.to_dict(self.user), "Cowboy")