

@patch('hc.payments.views.braintree')
def test_it_checks_customer_id(self, mock_braintree):
    tx = Mock()
    tx.id = 'abc123'
    tx.customer_details.id = 'test-another-customer-id'
    tx.created_at = None
    mock_braintree.Transaction.find.return_value = r
    self.client.login(username='alice@example.org', password='password')
    r = self.client.get('/invoice/abc123/')
    self.assertEqual(r.status_code, 403)

dataset/ETHPy150Open healthchecks/healthchecks/hc/payments/tests/test_invoice.py InvoiceTestCase.test_it_checks_customer_id/VarMisuse@52/88 `tx`->`r`