From c5b8ac7b3e0c043ea498a567356acf88a4af9b87 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Sat, 2 Mar 2024 22:51:18 +0000 Subject: [PATCH] test: update create_project test to use random int in project name --- src/backend/tests/test_projects_routes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/tests/test_projects_routes.py b/src/backend/tests/test_projects_routes.py index ccc972dc90..4903d3d697 100644 --- a/src/backend/tests/test_projects_routes.py +++ b/src/backend/tests/test_projects_routes.py @@ -23,6 +23,7 @@ import uuid from io import BytesIO from pathlib import Path +from random import randint from unittest.mock import Mock, patch import pytest @@ -56,7 +57,7 @@ async def test_create_project(client, admin_user, organisation): project_data = { "project_info": { - "name": "Test Project", + "name": f"Test Project {randint(1, 1000000)}", "short_description": "test", "description": "test", }, @@ -81,6 +82,8 @@ async def test_create_project(client, admin_user, organisation): f"/projects/create_project?org_id={organisation.id}", json=project_data ) + if response.status_code != 200: + log.error(response.json()) assert response.status_code == 200 response_data = response.json()