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

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