Skip to content

Commit

Permalink
Fix tests failing due to random ordering of ids
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorjerse committed Nov 8, 2023
1 parent 136f3db commit acb13f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions resolwe/flow/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1780,9 +1780,8 @@ def test_bulk_delete(self):
request_path, data={"ids": [entity1.pk, entity2.pk]}, format="json"
)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
self.assertEqual(
response.data["detail"],
f"No permission to delete objects with ids {entity1.pk}, {entity2.pk}.",
self.assertIn(
"No permission to delete objects with ids", response.data["detail"]
)
self.assertTrue(Entity.objects.filter(pk=entity1.pk).exists())
self.assertTrue(Entity.objects.filter(pk=entity2.pk).exists())
Expand Down
4 changes: 1 addition & 3 deletions resolwe/permissions/tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,9 +666,7 @@ def test_bulk_delete(self):
# No permission.
response = self.client.post(request_path, data={"ids": [1, 2]}, format="json")
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
self.assertEqual(
response.data["detail"], "No permission to delete objects with ids 1, 2."
)
self.assertIn("No permission to delete objects", response.data["detail"])
self.assertTrue(Data.objects.filter(pk=1).exists())
self.assertTrue(Data.objects.filter(pk=2).exists())

Expand Down

0 comments on commit acb13f1

Please sign in to comment.