@pytest.mark.django_db
def test_verify_user_duplicate_email(trans_member, member_with_email):
 trans_member.email = member_with_email.email
 with pytest.raises(ValidationError):
  accounts.utils.verify_user(trans_member)
 with pytest.raises(EmailAddress.DoesNotExist):
  EmailAddress.objects.get(user=trans_member, primary=True, verified=True)

@ pytest . mark . django_db def test_verify_user_duplicate_email ( trans_member , member_with_email ) : trans_member . email = member_with_email . email with pytest . raises ( ValidationError ) : accounts . utils . verify_user ( trans_member ) with pytest . raises ( EmailAddress . DoesNotExist ) : EmailAddress . objects . get ( user = trans_member , primary = True , verified = True )
test verifying user using verify_user function .