Skip to content

Commit d48c141

Browse files
committed
test
1 parent 9cbefa7 commit d48c141

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/sentry/users/models/test_user.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from unittest.mock import patch
22

3+
import pytest
4+
from django.db import IntegrityError
35
from django.db.models import Q
46

57
import sentry.hybridcloud.rpc.caching as caching_module
@@ -182,6 +184,11 @@ def test_salutation(self):
182184
assert user.email == "[email protected]"
183185
assert user.get_salutation_name() == "Hello"
184186

187+
def test_email_unique(self):
188+
self.create_user(email="[email protected]", username="123456")
189+
with pytest.raises(IntegrityError):
190+
self.create_user(email="[email protected]", username="789")
191+
185192

186193
ORG_MEMBER_MERGE_TESTED: set[NormalizedModelName] = set()
187194

0 commit comments

Comments
 (0)