@pytest.mark.django_db
def test_verify_user(member_with_email):
 with pytest.raises(EmailAddress.DoesNotExist):
  EmailAddress.objects.get(user=member_with_email, verified=True)
 accounts.utils.verify_user(member_with_email)
 EmailAddress.objects.get(user=member_with_email, email='member_with_email@this.test', primary=True, verified=True)

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