示例#1
0
 def test_good_pin(self):
     self.data["pin"] = "1234"
     form = BuyerValidation(self.data)
     assert form.is_valid()
示例#2
0
 def test_partially_numeric_pin(self):
     self.data["pin"] = "123a"
     form = BuyerValidation(self.data)
     assert not form.is_valid()
     assert "PIN may only consists of numbers" in form.errors["pin"]
示例#3
0
 def test_completely_alpha_pin(self):
     self.data["pin"] = "asfa"
     form = BuyerValidation(self.data)
     assert not form.is_valid()
     assert "PIN may only consists of numbers" in form.errors["pin"]
示例#4
0
 def test_too_short_pin(self):
     self.data["pin"] = "123"
     form = BuyerValidation(self.data)
     assert not form.is_valid()
     assert "PIN must be exactly 4 numbers long" in form.errors["pin"]