feat: customers buy with a CPF or a CNPJ
All checks were successful
Build and deploy / Validate source (push) Successful in 1m38s
Build and deploy / Integration suite on a real stack (push) Successful in 4m57s
Build and deploy / Secret scan and release gate (push) Successful in 13s
Build and deploy / Publish images (push) Successful in 2m1s
All checks were successful
Build and deploy / Validate source (push) Successful in 1m38s
Build and deploy / Integration suite on a real stack (push) Successful in 4m57s
Build and deploy / Secret scan and release gate (push) Successful in 13s
Build and deploy / Publish images (push) Successful in 2m1s
The cart and the account signup take either document, each with its own mask and check digits. Tiny gets a person (F) for a CPF, Mercado Pago the matching identification type, and only CNPJs go to the company registry. The Kanban, the account page and the alerts show which one it is. Also pins the Correios test's clock: its fake token expired today, so the suite failed from Oct 16 on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -137,6 +137,15 @@ class TinyTests(FakeTinyCase):
|
||||
self.assertNotIn(('POST', '/contatos'), self.calls)
|
||||
self.assertEqual(self.orders[0]['idContato'], 321)
|
||||
|
||||
def test_a_cpf_customer_is_a_person_and_not_looked_up_in_the_company_registry(self):
|
||||
looked_up = []
|
||||
self.tiny.names = lambda document: looked_up.append(document)
|
||||
person = {**PAID, 'order': {**PAID['order'], 'customer': {**PAID['order']['customer'], 'cnpj': '52998224725'}}}
|
||||
self.tiny.deliver('k-cpf', person)
|
||||
self.assertEqual((self.contacts[0]['tipoPessoa'], self.contacts[0]['cpfCnpj'], self.contacts[0]['nome']),
|
||||
('F', '52998224725', 'Loja Teste'))
|
||||
self.assertEqual(looked_up, [])
|
||||
|
||||
def test_production_events_are_not_sent(self):
|
||||
self.assertEqual(self.tiny.deliver('k2', {**PAID, 'event': 'ready'})['status'], 'not-applicable')
|
||||
self.assertEqual(self.calls, [])
|
||||
|
||||
Reference in New Issue
Block a user