def test_23rd_century_two_digit_month(self):
     p = PESEL().from_date(2299, 12, 29)
     p.generate()
     self.assertTrue(p.to_string().startswith("997229"))
 def test_22nd_century_two_digit_month(self):
     p = PESEL().from_date(2161, 11, 30)
     p.generate()
     self.assertTrue(p.to_string().startswith("615130"))
 def test_23rd_century_one_digit_month(self):
     p = PESEL().from_date(2200, 5, 30)
     p.generate()
     self.assertTrue(p.to_string().startswith("006530"))
 def test_21st_century_two_digit_month(self):
     p = PESEL().from_date(2020, 12, 30)
     p.generate()
     self.assertTrue(p.to_string().startswith("203230"))
 def test_22nd_century_one_digit_month(self):
     p = PESEL().from_date(2111, 4, 30)
     p.generate()
     self.assertTrue(p.to_string().startswith("114430"))
 def test_21st_century_one_digit_month(self):
     p = PESEL().from_date(2006, 3, 30)
     p.generate()
     self.assertTrue(p.to_string().startswith("062330"))
 def test_20th_century_two_digit_month(self):
     p = PESEL().from_date(1999, 12, 30)
     p.generate()
     self.assertTrue(p.to_string().startswith("991230"))
 def test_20th_century_one_digit_month(self):
     p = PESEL().from_date(1920, 2, 20)
     p.generate()
     self.assertTrue(p.to_string().startswith("200220"))
 def test_19th_century_one_digit_month(self):
     p = PESEL().from_date(1819, 1, 30)
     p.generate()
     self.assertTrue(p.to_string().startswith("198130"))
Beispiel #10
0
#!/usr/bin/env python3

import datetime
from pesel import PESEL

birthday = input("Podaj datę urodzenia: ")
birthday = datetime.datetime.strptime(birthday, "%d-%m-%Y")

pesel = PESEL().from_date(birthday.year, birthday.month, birthday.day)
pesel.generate()

print(pesel.to_string())