Skip to content

Commit

Permalink
Fix intermitent tests
Browse files Browse the repository at this point in the history
  • Loading branch information
romerosilva committed Aug 18, 2023
1 parent 69b4e06 commit fcae305
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/test_preference.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import unittest

import mercadopago
import time


class TestPreference(unittest.TestCase):
Expand Down Expand Up @@ -33,18 +34,22 @@ def test_all(self):
preference_saved = self.sdk.preference().create(preference_object)
self.assertEqual(preference_saved["status"], 201)

time.sleep(1)

preference_object["items"][0]["title"] = "Testando 1 2 3"

preference_update = self.sdk.preference().update(
preference_saved["response"]["id"], preference_object)
self.assertEqual(preference_update["status"], 200)

time.sleep(1)
preference_saved = self.sdk.preference().get(
preference_saved["response"]["id"])

self.assertEqual(preference_saved["response"]["items"][0]["title"],
preference_object["items"][0]["title"])

time.sleep(1)
preference_saved = self.sdk.preference().search()

self.assertEqual(preference_saved["response"]["elements"][0]["items"][0],
Expand Down
2 changes: 1 addition & 1 deletion tests/test_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def test_create_subscriptions_without_a_plan(self):
@classmethod
def create_card_token(cls):
card_token_object = {
"card_number": "4074090000000004",
"card_number": "5031433215406351",
"security_code": "123",
"expiration_year": datetime.now().strftime("%Y"),
"expiration_month": "12",
Expand Down

0 comments on commit fcae305

Please sign in to comment.