From bd68135b47423a788d3cbd80514d8e5906340b2f Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Fri, 28 Feb 2025 16:23:15 -0800 Subject: [PATCH] fix(tests): Attempt to fix flaky user creation again We caught the wrong error here, trying again --- src/sentry/testutils/fixtures.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sentry/testutils/fixtures.py b/src/sentry/testutils/fixtures.py index 9847ba7aa0564c..314d21eaf582a8 100644 --- a/src/sentry/testutils/fixtures.py +++ b/src/sentry/testutils/fixtures.py @@ -5,9 +5,9 @@ from typing import Any import pytest +from django.db.utils import IntegrityError from django.utils import timezone from django.utils.functional import cached_property -from psycopg2.errors import UniqueViolation from sentry.constants import ObjectStatus from sentry.eventstore.models import Event @@ -78,7 +78,7 @@ def user(self) -> User: is_staff=True, is_sentry_app=False, ) - except UniqueViolation: + except IntegrityError: return User.objects.get(email="admin@localhost") @cached_property