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

@ pytest . mark . django_db def test_update_user_email_without_existing_email ( trans_member ) : assert ( trans_member . email == '' ) with pytest . raises ( EmailAddress . DoesNotExist ) : EmailAddress . objects . get ( user = trans_member ) accounts . utils . update_user_email ( trans_member , 'trans_member@this.test' ) assert ( trans_member . email == 'trans_member@this.test' ) with pytest . raises ( EmailAddress . DoesNotExist ) : EmailAddress . objects . get ( user = trans_member )
test updating user email using update_user_email function .