Created
October 11, 2018 20:06
-
-
Save lucassimon/8aa7172e5c71e35c63726e1932b98226 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Third | |
import iugu | |
# Apps | |
# apps | |
from apps.zipcodes.postmon import postmon_search_cep | |
from apps.zipcodes.zip_code import translate_to_iugu | |
class TestCreateCustomer: | |
def setup_method(self): | |
iugu.config(token='xxxxxxxxxx') | |
self.customer = iugu.Customer() | |
def test_create_simple_customer_error_in_email(self): | |
data = { | |
'email': 'testeteste.com', 'name': 'Teste', | |
} | |
res = self.customer.create(data) | |
assert 'errors' in res.keys() | |
assert res.get('errors').get('email') == ['não é válido'] | |
def test_create_simple_customer(self): | |
data = { | |
'email': 'teste@teste.com', 'name': 'Teste', | |
'custom_variables': [{'name': 'object_id', 'value': '1234567890'}] | |
} | |
res = self.customer.create(data) | |
assert 'errors' not in res.keys() | |
res = self.customer.remove(res.get('id')) | |
assert 'errors' not in res.keys() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment