Ejemplo n.º 1
0
    def test_mark_positive_user_by_phone(self):
        """
        It tests that health authority can mark a customer as healed
        using only customer's phone number
        """
        user = create_user_on_db()
        assert user is not None
        assert user.role_id is 3
        positive = positive_with_user_id(user.id)
        assert positive is None
        message = HealthyServices.mark_positive("", user.phone)
        assert len(message) is 0

        message = HealthyServices.unmark_positive("", user.phone)
        assert len(message) is 0

        delete_was_positive_with_user_id(user.id)
        del_user_on_db(user.id)
Ejemplo n.º 2
0
    def test_search_contacts_user_with_booking_only_one_user(self):
        """
        Searching for list of contacts of a covid-19 positive
        customer with bookings
        """

        user = get_user_with_email("*****@*****.**")

        positive = positive_with_user_id(user.id)
        assert positive is None
        message = HealthyServices.mark_positive("", user.phone)
        assert len(message) == 0

        contacts = HealthyServices.search_contacts(user.id)
        assert len(contacts) == 0

        message = HealthyServices.unmark_positive("", user.phone)
        assert len(message) == 0

        delete_was_positive_with_user_id(user.id)
Ejemplo n.º 3
0
    def test_search_contacts_user_with_no_booking(self):
        """
        Searching for list of contacts of a covid-19 positive
        customer with no bookings
        """
        user = create_user_on_db()
        assert user is not None
        assert user.role_id is 3
        positive = positive_with_user_id(user.id)
        assert positive is None
        message = HealthyServices.mark_positive("", user.phone)
        assert len(message) is 0

        contacts = HealthyServices.search_contacts(user.id)
        assert len(contacts) is 0

        message = HealthyServices.unmark_positive("", user.phone)
        assert len(message) is 0

        delete_was_positive_with_user_id(user.id)
        del_user_on_db(user.id)