

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

dataset/ETHPy150Open healthchecks/healthchecks/hc/payments/tests/test_invoice.py InvoiceTestCase.test_it_works/VarMisuse@71/110 `self`->`tx`