summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-12 17:06:06 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-28 12:15:24 +0100
commit0d860bb0211ce14bbb86ffe7411ec2853852b64d (patch)
tree40b83b93c5fdf5bf7cca8634867f8fdfdcfcc6bf /archaeological_warehouse/tests.py
parent6e4f7a0390b7f49ce79f0e15e07e1d6df309f3ce (diff)
downloadIshtar-0d860bb0211ce14bbb86ffe7411ec2853852b64d.tar.bz2
Ishtar-0d860bb0211ce14bbb86ffe7411ec2853852b64d.zip
Container autocomplete: improve search
Diffstat (limited to 'archaeological_warehouse/tests.py')
-rw-r--r--archaeological_warehouse/tests.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/archaeological_warehouse/tests.py b/archaeological_warehouse/tests.py
index f6d877ec4..21833a08f 100644
--- a/archaeological_warehouse/tests.py
+++ b/archaeological_warehouse/tests.py
@@ -514,8 +514,8 @@ class ContainerTest(FindInit, TestCase):
)
def test_container_search(self):
- ct = models.ContainerType.objects.all()[0]
- ct2 = models.ContainerType.objects.all()[0]
+ ct = models.ContainerType.objects.order_by("id").all()[0]
+ ct2 = models.ContainerType.objects.order_by("id").all()[1]
container_1 = models.Container.objects.create(
reference="Test", responsible=self.main_warehouse,
location=self.main_warehouse,
@@ -547,9 +547,8 @@ class ContainerTest(FindInit, TestCase):
self.assertEqual(response.status_code, 200)
c = json.loads(response.content.decode())
self.assertEqual(len(c), 1)
- response = client.get(
- url,
- {"term": "{} Test {} Test 35000".format(ct.label, ct2.label)})
+ full_path = "{} Test {} 35000".format(ct.label, ct2.label)
+ response = client.get(url, {"term": full_path})
self.assertEqual(response.status_code, 200)
c = json.loads(response.content.decode())
self.assertEqual(len(c), 1)