From 2777c68b8727546c17dcb44078d2d1eb0c5ab19f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 15 Dec 2020 23:24:46 +0100 Subject: Tests: fix M2M test (false positive) --- archaeological_finds/tests.py | 4 +--- archaeological_warehouse/models.py | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index 9e63f1ddb..c5d860cad 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -1268,6 +1268,7 @@ class FindSearchTest(FindInit, TestCase, SearchText): self._test_search(c, result, context="One container in his " "reference location") + class FindAutocompleteTest(FindInit, TestCase): fixtures = WAREHOUSE_FIXTURES model = models.Find @@ -1798,9 +1799,6 @@ class FindHistoryTest(FindInit, TestCase): self.assertEqual(response.status_code, 200) self.assertIn(b'class="card sheet"', response.content) content = response.content.decode('utf-8') - self.assertNotIn( - models.MaterialType.objects.get(txt_idx='ceramic').label, - content) self.assertNotIn( Period.objects.get(txt_idx='neolithic').label, content) self.assertNotIn("5001", content) diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index c9bd4b494..8f4d0662e 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -1449,9 +1449,8 @@ class ContainerLocalisation(models.Model): ordering = ('container', 'division__order') def __str__(self): - lbl = " - ".join((str(self.container), - str(self.division), self.reference)) - return lbl + return " - ".join((str(self.container), str(self.division), + self.reference)) def natural_key(self): return self.container.uuid, self.division.warehouse.uuid,\ -- cgit v1.2.3