@pytest.mark.django_db
def test_verify_user_with_primary_and_non_primary_email_object(trans_member):
 member = trans_member
 member.email = 'member@this.test'
 EmailAddress.objects.create(user=member, email=member.email, primary=False, verified=False)
 EmailAddress.objects.create(user=member, email='otheremail@this.test', primary=True, verified=False)
 accounts.utils.verify_user(member)
 EmailAddress.objects.get(user=member, email='otheremail@this.test', primary=True, verified=True)

@ pytest . mark . django_db def test_verify_user_with_primary_and_non_primary_email_object ( trans_member ) : member = trans_member member . email = 'member@this.test' EmailAddress . objects . create ( user = member , email = member . email , primary = False , verified = False ) EmailAddress . objects . create ( user = member , email = 'otheremail@this.test' , primary = True , verified = False ) accounts . utils . verify_user ( member ) EmailAddress . objects . get ( user = member , email = 'otheremail@this.test' , primary = True , verified = True )
test verifying user using verify_user function that has an allauth .