def test_returns_nothing_if_one_criteria_does_not_match(self, app): # given user = create_user(first_name="Jean", last_name='DOe', date_of_birth=datetime(2000, 5, 1)) PcObject.save(user) # when users = find_by_civility('john', 'doe', datetime(2000, 5, 1)) # then assert not users
def test_returns_users_with_matching_criteria_first_and_last_names_and_birthdate_and_invalid_email(self, app): # given user1 = create_user(first_name="john", last_name='DOe', email='*****@*****.**', date_of_birth=datetime(2000, 5, 1)) user2 = create_user(first_name="jaNE", last_name='DOe', email='*****@*****.**', date_of_birth=datetime(2000, 3, 20)) PcObject.save(user1, user2) # when users = find_by_civility('john', 'doe', datetime(2000, 5, 1)) # then assert len(users) == 1 assert users[0].email == '*****@*****.**'
def test_returns_users_with_matching_criteria_ignoring_accents(self, app): # given user2 = create_user(first_name="jaNE", last_name='DOe', email='*****@*****.**', date_of_birth=datetime(2000, 3, 20)) user1 = create_user(first_name="john bob", last_name='doe', email='*****@*****.**', date_of_birth=datetime(2000, 5, 1)) PcObject.save(user1, user2) # when users = find_by_civility('jöhn bób', 'doe', datetime(2000, 5, 1)) # then assert len(users) == 1 assert users[0].email == '*****@*****.**'