summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/tests.py
diff options
context:
space:
mode:
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)