Skip to content

Commit 68bf1de

Browse files
committed
update tests
1 parent 26bb7df commit 68bf1de

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

osf/models/mixins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ def add_unregistered_contributor(
15841584
# Create a new user record if you weren't passed an existing user
15851585
contributor = existing_user if existing_user else OSFUser.create_unregistered(fullname=fullname, email=email)
15861586

1587-
if existing_user is None and has_domain_in_user_fields_for_names(contributor):
1587+
if has_domain_in_user_fields_for_names(contributor):
15881588
raise ValidationError('Invalid personal information.')
15891589

15901590
try:

osf_tests/test_user.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,19 +2090,19 @@ def test_validate_domain_fields_unregistered_contributor(self):
20902090
project = ProjectFactory(creator=self.user)
20912091
with pytest.raises(ValidationError):
20922092
project.add_unregistered_contributor(
2093-
fullname='google.com',
2094-
email='spammy@example.com',
2093+
fullname='Visit google.com for fun spam action',
2094+
email='spammy@cos.io',
20952095
auth=Auth(self.user),
20962096
notification_type=False,
20972097
)
2098-
assert not OSFUser.objects.filter(username='spammy@example.com').exists()
2098+
assert not OSFUser.objects.filter(username='spammy@cos.io').exists()
20992099

21002100
def test_validate_domain_fields_notable_domain_unregistered_contributor(self):
21012101
NotableDomain.objects.get_or_create(domain='google.com', note=NotableDomain.Note.IGNORED)
21022102
project = ProjectFactory(creator=self.user)
21032103
contributor = project.add_unregistered_contributor(
21042104
fullname='google.com',
2105-
email='notspammy@example.com',
2105+
email='notspammy@cos.io',
21062106
auth=Auth(self.user),
21072107
notification_type=False,
21082108
)
@@ -2112,7 +2112,7 @@ def test_validate_domain_fields_no_domain(self):
21122112
project = ProjectFactory(creator=self.user)
21132113
contributor = project.add_unregistered_contributor(
21142114
fullname='Sandhya N.Sathesh',
2115-
email='sandhya@example.com',
2115+
email='sandhya@cos.io',
21162116
auth=Auth(self.user),
21172117
notification_type=False,
21182118
)

osf_tests/test_validators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_has_domain_in_user_fields(user_data):
168168
'fullname': 'Judith Sarah',
169169
'given_name': 'Judith',
170170
'family_name': 'Preuss',
171-
'middle_names': 'https://www.google.com',
171+
'middle_names': 'Visit https://www.google.com today',
172172
'suffix': 'M.Sc.',
173173
},
174174
{

0 commit comments

Comments
 (0)