예제 #1
0
 def test_reset_confirm_pin_with_bad_pin(self):
     uuid = 'reset_confirm_pin_bad_pin'
     new_pin = '1122'
     client.create_buyer(uuid, self.pin)
     client.set_new_pin(uuid, new_pin)
     assert client.reset_confirm_pin(uuid, new_pin)
     assert client.verify_pin(uuid, new_pin)
     assert not client.reset_confirm_pin(uuid, self.pin)
     assert client.verify_pin(uuid, new_pin)
예제 #2
0
    def clean_pin(self, *args, **kwargs):
        pin = self.cleaned_data['pin']
        if self.handle_client_errors(client.reset_confirm_pin(self.uuid, pin)):
            return pin

        self.add_error_code('PINS_DONT_MATCH')
        raise forms.ValidationError(_("Pins do not match."))
예제 #3
0
파일: tests.py 프로젝트: raulmalea/webpay
 def test_reset_confirm_pin_with_good_pin(self):
     uuid = "reset_confirm_pin_good_pin"
     new_pin = "1122"
     client.create_buyer(uuid, self.pin)
     client.set_new_pin(uuid, new_pin)
     assert client.reset_confirm_pin(uuid, new_pin)
     assert client.verify_pin(uuid, new_pin)
예제 #4
0
    def clean_pin(self, *args, **kwargs):
        pin = self.cleaned_data['pin']
        if self.handle_client_errors(client.reset_confirm_pin(self.uuid, pin)):
            return pin

        self.add_error_code('PINS_DONT_MATCH')
        raise forms.ValidationError(_("Pins do not match."))
예제 #5
0
파일: tests.py 프로젝트: MorrisJobke/webpay
 def test_reset_confirm_pin_with_bad_pin(self, slumber):
     new_pin = '1122'
     buyer = mock.Mock(return_value=self.buyer_data)
     buyer.patch.return_value = {}
     slumber.generic.buyer.return_value = buyer
     client.set_new_pin(self.uuid, new_pin)
     slumber.generic.reset_confirm_pin.post.return_value = {
         'confirmed': False
     }
     assert not client.reset_confirm_pin(self.uuid, new_pin)
예제 #6
0
파일: tests.py 프로젝트: lissyx/webpay
 def test_reset_confirm_pin_with_bad_pin(self, slumber):
     new_pin = '1122'
     buyer = mock.Mock(return_value=self.buyer_data)
     buyer.patch.return_value = {}
     slumber.generic.buyer.return_value = buyer
     client.set_new_pin(self.uuid, new_pin)
     slumber.generic.reset_confirm_pin.post.return_value = {
         'confirmed': False
     }
     assert not client.reset_confirm_pin(self.uuid, new_pin)
예제 #7
0
파일: forms.py 프로젝트: AltisCorp/webpay
    def clean_pin(self, *args, **kwargs):
        pin = self.cleaned_data['pin']
        if self.handle_client_errors(client.reset_confirm_pin(self.uuid, pin)):
            return pin

        raise forms.ValidationError(_('PIN does not match.'))