@pytest.mark.django_db
def test_update_user_email_with_unverified_acc(member_with_email):
 EmailAddress.objects.create(user=member_with_email, email=member_with_email.email, primary=True, verified=False).save()
 accounts.utils.update_user_email(member_with_email, 'new_email_address@this.test')
 email_address = EmailAddress.objects.get(user=member_with_email)
 assert (member_with_email.email == 'new_email_address@this.test')
 assert (email_address.email == 'new_email_address@this.test')
 assert (email_address.verified is False)

@ pytest . mark . django_db def test_update_user_email_with_unverified_acc ( member_with_email ) : EmailAddress . objects . create ( user = member_with_email , email = member_with_email . email , primary = True , verified = False ) . save ( ) accounts . utils . update_user_email ( member_with_email , 'new_email_address@this.test' ) email_address = EmailAddress . objects . get ( user = member_with_email ) assert ( member_with_email . email == 'new_email_address@this.test' ) assert ( email_address . email == 'new_email_address@this.test' ) assert ( email_address . verified is False )
test updating user email using update_user_email function .