From 99103bc41946f6de06f99030a2f6a1f9b41de9ee Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Wed, 25 Sep 2024 16:43:41 +0200 Subject: [PATCH] Revert "fixed space test to reflect new logic" This reverts commit fcf9f30af0e407e238e2174c5528cf00b7650a9c. --- cookbook/tests/api/test_api_space.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cookbook/tests/api/test_api_space.py b/cookbook/tests/api/test_api_space.py index 8e7c635c5..a9b2a27a9 100644 --- a/cookbook/tests/api/test_api_space.py +++ b/cookbook/tests/api/test_api_space.py @@ -13,11 +13,11 @@ DETAIL_URL = 'api:space-detail' @pytest.mark.parametrize("arg", [ - ['a_u', 403], - ['g1_s1', 200], - ['u1_s1', 200], - ['a1_s1', 200], - ['a2_s1', 200], + ['a_u', 403, 0], + ['g1_s1', 200, 1], + ['u1_s1', 200, 1], + ['a1_s1', 200, 1], + ['a2_s1', 200, 1], ]) def test_list_permission(arg, request, space_1, a1_s1): space_1.created_by = auth.get_user(a1_s1) @@ -25,6 +25,8 @@ def test_list_permission(arg, request, space_1, a1_s1): c = request.getfixturevalue(arg[0]) result = c.get(reverse(LIST_URL)) assert result.status_code == arg[1] + if arg[1] == 200: + assert len(json.loads(result.content)) == arg[2] def test_list_multiple(u1_s1, space_1, space_2):