Пример #1
0
    def clean_pin(self, *args, **kwargs):
        pin = self.cleaned_data['pin']
        if self.handle_client_errors(client.confirm_pin(self.uuid, pin)):
            return pin

        self.add_error_code('PINS_DONT_MATCH')
        raise forms.ValidationError(_("Pins do not match."))
Пример #2
0
    def clean_pin(self, *args, **kwargs):
        pin = self.cleaned_data['pin']
        if self.handle_client_errors(client.confirm_pin(self.uuid, pin)):
            return pin

        self.add_error_code('PINS_DONT_MATCH')
        raise forms.ValidationError(_("Pins do not match."))
Пример #3
0
 def test_confirm_pin_with_bad_pin(self, slumber):
     slumber.generic.confirm_pin.post.return_value = {'confirmed': False}
     assert not client.confirm_pin(self.uuid, self.pin[::-1])
Пример #4
0
 def test_confirm_pin_with_good_pin(self, slumber):
     slumber.generic.confirm_pin.post.return_value = {'confirmed': True}
     assert client.confirm_pin(self.uuid, self.pin)
Пример #5
0
    def clean_pin(self, *args, **kwargs):
        pin = self.cleaned_data['pin']
        if self.handle_client_errors(client.confirm_pin(self.uuid, pin)):
            return pin

        raise forms.ValidationError(_('PIN does not match.'))
Пример #6
0
 def test_verify_with_confirm_and_good_pin(self):
     uuid = 'verify_pin_confirm_pin_good_pin'
     client.create_buyer(uuid, self.pin)
     assert client.confirm_pin(uuid, self.pin)
     assert client.verify_pin(uuid, self.pin)['valid']
Пример #7
0
 def test_confirm_pin_with_bad_pin(self):
     uuid = 'confirm_pin_bad_pin'
     client.create_buyer(uuid, self.pin)
     assert not client.confirm_pin(uuid, self.pin[::-1])
Пример #8
0
 def test_confirm_pin_with_good_pin(self):
     uuid = 'confirm_pin_good_pin'
     client.create_buyer(uuid, self.pin)
     assert client.confirm_pin(uuid, self.pin)
Пример #9
0
 def test_confirm_pin_with_bad_pin(self, slumber):
     slumber.generic.confirm_pin.post.return_value = {'confirmed': False}
     assert not client.confirm_pin(self.uuid, self.pin[::-1])
Пример #10
0
 def test_confirm_pin_with_good_pin(self, slumber):
     slumber.generic.confirm_pin.post.return_value = {'confirmed': True}
     assert client.confirm_pin(self.uuid, self.pin)