Esempio n. 1
0
    def test_returns_nothing_if_one_criteria_does_not_match(self, app):
        # given
        user = create_user(date_of_birth=datetime(2000, 5, 1),
                           first_name="Jean",
                           last_name="DOe")
        repository.save(user)

        # when
        users = find_by_civility("john", "doe", datetime(2000, 5, 1))

        # then
        assert not users
Esempio n. 2
0
    def test_returns_users_with_matching_criteria_ignoring_accents(self, app):
        # given
        user2 = create_user(date_of_birth=datetime(2000, 3, 20),
                            email="*****@*****.**",
                            first_name="jaNE",
                            last_name="DOe")
        user1 = create_user(date_of_birth=datetime(2000, 5, 1),
                            email="*****@*****.**",
                            first_name="john bob",
                            last_name="doe")
        repository.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 == "*****@*****.**"
Esempio n. 3
0
def get_beneficiary_duplicates(first_name: str, last_name: str, date_of_birth: datetime) -> List[User]:
    return find_by_civility(first_name=first_name, last_name=last_name, date_of_birth=date_of_birth)