From dc1dca59f1642460effbd7185711c5f691a19e9c Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Sun, 20 Jan 2019 11:26:40 +0100 Subject: Do not rely on hardcoded ID. --- api/tests/test_infractions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api/tests') diff --git a/api/tests/test_infractions.py b/api/tests/test_infractions.py index 42010973..7c370c17 100644 --- a/api/tests/test_infractions.py +++ b/api/tests/test_infractions.py @@ -181,7 +181,7 @@ class CreationTests(APISubdomainTestCase): response = self.client.post(url, data=data) self.assertEqual(response.status_code, 201) - infraction = Infraction.objects.get(id=1) + infraction = Infraction.objects.get(id=response.json()['id']) self.assertAlmostEqual( infraction.inserted_at, dt.now(timezone.utc), -- cgit v1.2.3