def test_ibancheckABunchOfValidOnes(self): #taken from #http://www.rbs.co.uk/corporate/international/g0/guide-to-international-business/regulatory-information/iban/iban-example.ashx ibans = { "Just long enough": "AB451", "Albania": "AL47 2121 1009 0000 0002 3569 8741", "Austria": "AT61 1904 3002 3457 3201", "France": "FR14 2004 1010 0505 0001 3M02 606", "Germany": "DE89 3704 0044 0532 0130 00", # "United Kingdom": "GB29 RBOS 6016 1331 9268 19" This is actually a false number "United Kingdom": "GB29 NWBK 6016 1331 9268 19", "Italy": "IT40 S054 2811 1010 0000 0123 456", "Liechtenstein": "LI21 0881 0000 2324 013A A", "Spain": "ES80 2310 0001 1800 0001 2345", "Switzerland": "CH93 0076 2011 6238 5295 7" } for country, iban in ibans.items(): self.assertTrue(IBANcheck.check(iban), "Didn't work for " + country)
def test_ibancheckFalseDE(self): self.assertFalse(IBANcheck.check("DE84370400440532013000"))
def test_ibancheckDE(self): self.assertTrue(IBANcheck.check("DE89370400440532013000"))
def test_ibancheckWithSpacesUK(self): self.assertTrue(IBANcheck.check("GB29 NWBK 6016 1331 9268 19"))