Skip to content

Instantly share code, notes, and snippets.

@lucassimon
Created October 11, 2018 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucassimon/8aa7172e5c71e35c63726e1932b98226 to your computer and use it in GitHub Desktop.
Save lucassimon/8aa7172e5c71e35c63726e1932b98226 to your computer and use it in GitHub Desktop.
# -*- 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