Esempio n. 1
0
    def test_validate_confirm_password(self):
        user_service = pretend.stub(
            find_userid=pretend.call_recorder(lambda userid: 1),
            check_password=pretend.call_recorder(
                lambda userid, password, tags=None: True),
        )
        form = forms.DeleteTOTPForm(username="******",
                                    user_service=user_service,
                                    password="******")

        assert form.validate()
Esempio n. 2
0
    def test_validate_confirm_password(self):
        request = pretend.stub(remote_addr="1.2.3.4")
        user_service = pretend.stub(
            find_userid=pretend.call_recorder(lambda userid: 1),
            check_password=pretend.call_recorder(
                lambda userid, password, tags=None: True),
        )
        form = forms.DeleteTOTPForm(
            username="******",
            request=request,
            user_service=user_service,
            password="******",
        )

        assert form.validate()
Esempio n. 3
0
    def test_creation(self):
        user_service = pretend.stub()
        form = forms.DeleteTOTPForm(user_service=user_service)

        assert form.user_service is user_service