def test_get_user(self): """ Match the email and return user if exists. """ # Create users from factory UserFactory(username='******', email='*****@*****.**') assert get_user_from_email({'email': '*****@*****.**'}) assert not get_user_from_email({'email': '*****@*****.**'})
def get_user(): """ This is the helper method to get the user from system by matching email. """ user_details = {'email': details.get('email')} if details else None return get_user_from_email(user_details or {})