spookylukey / django-paypal

A pluggable Django application for integrating PayPal Payments Standard or Payments Pro
MIT License
729 stars 208 forks source link

untested warning for is_subscription #272

Open newearthmartin opened 2 years ago

newearthmartin commented 2 years ago

Hi, I'm getting an untested warning for PayPalStandardBase.is_subcription()

paypal.standard.models:286: This method (or branch) is not covered by automated tests. It is therefore very vulnerable to being accidentally broken by future versions of django-paypal. Please contribute tests to ensure future functionality!

The method itself is just one line:

    def is_subscription(self):
        warn_untested()
        return len(self.subscr_id) > 0

So I wonder what kind of test would be needed for this. Or if it's pointing to the more generic subscription logic?

VinneyJ commented 1 year ago

Hi, @newearthmartin I am new to this repo and interested. Is this something I can look into and try solving or was it fixed? and Is there any contributing guide?

newearthmartin commented 1 year ago

@spookylukey care to answer to this new contributor @VinneyJ ?

spookylukey commented 1 year ago

A good test would be like this:

It would be nice to add tests for the other methods like is_subscription_payment etc., based on real data, and also make any corrections to these methods as necessary.

VinneyJ commented 1 year ago

Thanks a lot, @spookylukey let me dive in and check it out.