Skip to content

Test disbursement objects throw AttributeError for is_credit() and is_debit()  #126

@bcdickinson

Description

@bcdickinson

General information

  • SDK/Library version: 3.59.0
  • Environment: Local testing
  • Language, language version, and OS: Python 3.8.6 (python:3.8-buster Docker image)

Issue description

Test disbursement webhook notifications are missing the disbursement_type attribute, causing the is_credit() and is_debit() methods to throw AttributeErrors:

>>> webhook_notification = self.gateway.webhook_testing.sample_notification(
>>>   braintree.WebhookNotification.Kind.Disbursement,
>>>   "test_disbursement_id",
>>> )
>>> webhook_notification.disbursement.is_credit()                                                                     
Traceback (most recent call last):                                                               
  File "<pudb command line>", line 1, in <module>                                                
  File "/usr/local/lib/python3.8/site-packages/braintree/disbursement.py", line 27, in is_credit 
    return self.disbursement_type == Disbursement.Type.Credit                                    
AttributeError: 'Disbursement' object has no attribute 'disbursement_type'                       

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions