Skip to content

Conversation

devkral
Copy link
Contributor

@devkral devkral commented Oct 6, 2017

Instead of using prefixed address fields in Model, use functions to retrieve the data.
This way different data sources can be used and a fallback can be provided (BasePaymentWithAddress) in case only one address is available.
BasePayment is split in Logic and Model. This allows better tests with less rendundancy.
The resulting testmock is in testcommon (test_common would be executed)

…s (allows much more freedom) and adjust all providers for the change

use create_test_payment for tests, TestPayment is now a Mock
use unittest mocks when python3
@codecov-io
Copy link

codecov-io commented Oct 6, 2017

Codecov Report

Merging #149 into master will increase coverage by 1.68%.
The diff coverage is 89.2%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #149      +/-   ##
==========================================
+ Coverage   79.13%   80.81%   +1.68%     
==========================================
  Files          27       28       +1     
  Lines        1649     1757     +108     
  Branches      190      194       +4     
==========================================
+ Hits         1305     1420     +115     
+ Misses        245      237       -8     
- Partials       99      100       +1
Impacted Files Coverage Δ
payments/sofort/__init__.py 87.71% <ø> (-1.17%) ⬇️
payments/testcommon.py 100% <100%> (ø)
payments/braintree/forms.py 93.1% <100%> (+0.51%) ⬆️
payments/stripe/forms.py 96.92% <100%> (+0.09%) ⬆️
payments/cybersource/__init__.py 66.56% <100%> (+0.1%) ⬆️
payments/authorizenet/__init__.py 79.54% <100%> (ø) ⬆️
payments/sagepay/__init__.py 90.76% <66.66%> (+2.05%) ⬆️
payments/models.py 84.12% <72.91%> (+9.33%) ⬆️
payments/utils.py 91.66% <90%> (-8.34%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 49c93aa...0ec5816. Read the comment docs.

@mariofix
Copy link
Member

@WhyNotHugo How do you feel about updating this pr to the current codebase? We could use a JSONField to store the billing and shipping information separetely in the same payment object.

@devkral
Copy link
Contributor Author

devkral commented Oct 28, 2024

the PR is 7 years old ;). 4 years older than my children.

I reworked the PR in a spinoff I had no time to update for years. When I find time I can rework it

@mariofix
Copy link
Member

the PR is 7 years old ;). 4 years older than my children.

I reworked the PR in a spinoff I had no time to update for years. When I find time I can rework it

hahaha, yes, maybe trying to pick it up from here.

Hope everything is well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants