diff --git a/app/api/tests/unit/test_unit_api_fields.py b/app/api/tests/unit/test_unit_api_fields.py index c7745164..c9dc6a3a 100644 --- a/app/api/tests/unit/test_unit_api_fields.py +++ b/app/api/tests/unit/test_unit_api_fields.py @@ -1,3 +1,4 @@ +import datetime import pytest from django.contrib.auth.models import ContentType, Permission, User @@ -105,6 +106,8 @@ class APIFieldsTestCases: with django_db_blocker.unblock(): + random_str = datetime.datetime.now(tz=datetime.timezone.utc) + request.cls.organization = organization_one request.cls.different_organization = organization_two @@ -150,7 +153,7 @@ class APIFieldsTestCases: ) view_team = Team.objects.create( - team_name = 'cs_api_view_team', + team_name = 'cs_api_view_team' + str(random_str), organization = request.cls.organization, ) @@ -158,8 +161,7 @@ class APIFieldsTestCases: view_team.permissions.set([view_permissions]) - - request.cls.view_user = User.objects.create_user(username="cafs_test_user_view", password="password") + request.cls.view_user = User.objects.create_user(username="cafs_test_user_view" + str(random_str), password="password") team_user = TeamUsers.objects.create( team = view_team, diff --git a/app/conftest.py b/app/conftest.py index 1cf5a4e2..594a0513 100644 --- a/app/conftest.py +++ b/app/conftest.py @@ -1,3 +1,4 @@ +import datetime import pytest import sys @@ -485,8 +486,10 @@ def organization_one(django_db_blocker): with django_db_blocker.unblock(): + random_str = datetime.datetime.now(tz=datetime.timezone.utc) + item = Organization.objects.create( - name = 'org one' + name = 'org one from global' + str(random_str) ) yield item @@ -504,8 +507,10 @@ def organization_two(django_db_blocker): with django_db_blocker.unblock(): + random_str = datetime.datetime.now(tz=datetime.timezone.utc) + item = Organization.objects.create( - name = 'org two' + name = 'org two from global' + str(random_str) ) yield item diff --git a/app/core/tests/functional/ticket_comment_base/test_functional_ticket_comment_base_model.py b/app/core/tests/functional/ticket_comment_base/test_functional_ticket_comment_base_model.py index d48e5244..57d41726 100644 --- a/app/core/tests/functional/ticket_comment_base/test_functional_ticket_comment_base_model.py +++ b/app/core/tests/functional/ticket_comment_base/test_functional_ticket_comment_base_model.py @@ -39,6 +39,10 @@ class TicketCommentBaseModelTestCases( with django_db_blocker.unblock(): + for comment in ticket.ticketcommentbase_set.all(): + + comment.delete() + ticket.delete() diff --git a/app/core/tests/unit/ticket_comment_base/test_unit_ticket_comment_base_model.py b/app/core/tests/unit/ticket_comment_base/test_unit_ticket_comment_base_model.py index 7380b87f..0515450f 100644 --- a/app/core/tests/unit/ticket_comment_base/test_unit_ticket_comment_base_model.py +++ b/app/core/tests/unit/ticket_comment_base/test_unit_ticket_comment_base_model.py @@ -1,3 +1,4 @@ +import datetime import pytest from django.contrib.auth.models import User @@ -154,6 +155,8 @@ class TicketCommentBaseModelTestCases( with django_db_blocker.unblock(): + random_str = datetime.datetime.now(tz=datetime.timezone.utc) + request.cls.organization = organization_one request.cls.different_organization = organization_two @@ -176,7 +179,7 @@ class TicketCommentBaseModelTestCases( request.cls.kwargs_create_item = kwargs_create_item - request.cls.view_user = User.objects.create_user(username="cafs_test_user_view", password="password") + request.cls.view_user = User.objects.create_user(username="ticket_comment_user_"+ str(random_str), password="password") comment_category = TicketCommentCategory.objects.create( organization = request.cls.organization,