1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
from tests.test_helper import *
class TestApplePayCard(unittest.TestCase):
def test_expiration_date(self):
card = ApplePayCard(None, {
"customer_id": "12345",
"number": "4111111111111111",
"expiration_month": "05",
"expiration_year": "2014",
"cvv": "100",
"cardholder_name": "John Doe"
})
self.assertEqual("05/2014", card.expiration_date)
def test_expiration_date_no_month(self):
card = ApplePayCard(None, {
"customer_id": "12345",
"number": "4111111111111111",
"expiration_month": "",
"expiration_year": "2014",
"cvv": "100",
"cardholder_name": "John Doe"
})
self.assertEqual(None, card.expiration_date)
def test_expiration_date_no_year(self):
card = ApplePayCard(None, {
"customer_id": "12345",
"number": "4111111111111111",
"expiration_month": "05",
"expiration_year": "",
"cvv": "100",
"cardholder_name": "John Doe"
})
self.assertEqual(None, card.expiration_date)
|