Skip to content

Commit c49a72a

Browse files
committed
change methods test card
1 parent 03b0606 commit c49a72a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tests/test_card.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@ class TestCard(unittest.TestCase):
1313
"""
1414
Test Module: Card
1515
"""
16+
_customer_id = None
1617
sdk = mercadopago.SDK(
1718
"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966")
1819

1920
@classmethod
2021
def setUpClass(cls):
21-
cls._customer_id = cls.createCustomer(cls())["response"]["id"]
22+
cls._customer_id = cls.createCustomer()["response"]["id"]
2223

2324
@classmethod
2425
def tearDownClass(cls):
25-
cls.deleteCustomer(cls())
26+
cls.deleteCustomer()
2627

2728
def test_all(self):
2829
"""
@@ -55,7 +56,8 @@ def test_all(self):
5556

5657
self.sdk.card().delete(self._customer_id, card_created["response"]["id"])
5758

58-
def createCustomer(self):
59+
@classmethod
60+
def createCustomer(cls):
5961
customer_object = {
6062
"email": "[email protected]",
6163
"first_name": "Rafa",
@@ -76,10 +78,11 @@ def createCustomer(self):
7678
"description": "customer description"
7779
}
7880

79-
return self.sdk.customer().create(customer_object)
81+
return cls.sdk.customer().create(customer_object)
8082

81-
def deleteCustomer(self):
82-
self.sdk.customer().delete(self._customer_id)
83+
@classmethod
84+
def deleteCustomer(cls):
85+
cls.sdk.customer().delete(cls._customer_id)
8386

8487

8588
if __name__ == "__main__":

0 commit comments

Comments
 (0)