Skip to content

Commit

Permalink
test: guarantee randomness with uuid4 over randint
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Jul 2, 2024
1 parent 553614b commit a667e4d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/backend/tests/test_projects_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import os
from io import BytesIO
from pathlib import Path
from random import randint
from unittest.mock import Mock, patch
from uuid import uuid4

import pytest
import requests
Expand Down Expand Up @@ -52,7 +52,7 @@ async def test_create_project(client, admin_user, organisation):

project_data = {
"project_info": {
"name": f"Test Project {randint(1, 1000000)}",
"name": f"Test Project {uuid4()}",
"short_description": "test",
"description": "test",
},
Expand Down Expand Up @@ -87,7 +87,6 @@ async def test_create_project(client, admin_user, organisation):

async def test_delete_project(client, admin_user, project):
"""Test deleting a FMTM project, plus ODK Central project."""
log.warning(project)
response = client.delete(f"/projects/{project.id}")
assert response.status_code == 204

Expand Down Expand Up @@ -279,7 +278,7 @@ async def test_update_project(client, admin_user, project):
"""Test update project metadata."""
updated_project_data = {
"project_info": {
"name": f"Updated Test Project {randint(1, 1000000)}",
"name": f"Updated Test Project {uuid4()}",
"short_description": "updated short description",
"description": "updated description",
},
Expand Down

0 comments on commit a667e4d

Please sign in to comment.