示例#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
文件: forms.py 项目: AltisCorp/webpay
    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
文件: tests.py 项目: lissyx/webpay
 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
文件: tests.py 项目: lissyx/webpay
 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)