Skip to content

Commit

Permalink
Flake8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigo-barraza committed Dec 4, 2023
1 parent 01aa77e commit 40a4b47
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions pay-api/src/pay_api/models/non_sufficient_funds.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class NonSufficientFundsSchema(BaseSchema): # pylint: disable=too-many-ancestor

class Meta(BaseSchema.Meta): # pylint: disable=too-few-public-methods
"""Returns all the fields from the SQLAlchemy class."""

model = NonSufficientFundsModel

description = fields.String(data_key='description')
Expand Down
8 changes: 4 additions & 4 deletions pay-api/src/pay_api/services/non_sufficient_funds.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

from flask import current_app

from pay_api.models import NonSufficientFundsModel
from pay_api.models import NonSufficientFundsSchema
from pay_api.models import InvoiceSchema
from pay_api.models import InvoiceReference as InvoiceReferenceModel
from pay_api.models import Invoice as InvoiceModel
from pay_api.models import NonSufficientFundsModel
from pay_api.models import NonSufficientFundsSchema
from pay_api.models import Payment as PaymentModel
from pay_api.models import PaymentSchema
from pay_api.models import PaymentAccount as PaymentAccountModel
from pay_api.models import InvoiceReference as InvoiceReferenceModel
from pay_api.models import db


Expand Down Expand Up @@ -136,7 +136,7 @@ def find_all_non_sufficient_funds_invoices(account_id: str, page: int, limit: in
# pylint: disable=too-many-locals
"""Return all Non-Sufficient Funds."""
results, total = NonSufficientFundsService.query_all_non_sufficient_funds_invoices(account_id=account_id,
page=page, limit=limit)
page=page, limit=limit)

data = {
'total': total,
Expand Down
3 changes: 1 addition & 2 deletions pay-api/tests/unit/api/test_non_sufficient_funds.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
"""
from pay_api.models import FeeSchedule
from pay_api.models import PaymentAccount
from pay_api.utils.enums import InvoiceStatus
from tests.utilities.base_test import (
factory_invoice_reference, factory_invoice, factory_non_sufficient_funds, factory_payment,
factory_payment_account, factory_payment_line_item, get_claims, token_header)
from pay_api.utils.enums import (
InvoiceStatus)


def test_get_non_sufficient_funds(session, client, jwt, app):
Expand Down
3 changes: 2 additions & 1 deletion pay-api/tests/unit/models/test_non_sufficient_funds.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ def test_non_sufficient_funds(session):

assert non_sufficient_funds.id is not None
assert non_sufficient_funds.invoice_id is not None
assert non_sufficient_funds.description is not None
assert non_sufficient_funds.description is not None

6 changes: 3 additions & 3 deletions pay-api/tests/unit/services/test_non_sufficient_funds.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@

from pay_api.models import FeeSchedule
from pay_api.services import NonSufficientFundsService
from pay_api.utils.enums import InvoiceStatus
from tests.utilities.base_test import (
factory_invoice_reference, factory_invoice, factory_non_sufficient_funds, factory_payment,
factory_payment_account, factory_payment_line_item)
from pay_api.utils.enums import (
InvoiceStatus)


def test_save_non_sufficient_funds(session):
Expand All @@ -33,11 +32,12 @@ def test_save_non_sufficient_funds(session):
'description': 'NSF',
}
non_sufficient_funds = NonSufficientFundsService.save_non_sufficient_funds(invoice_id=1,
description='NSF')
description='NSF')
assert non_sufficient_funds
assert non_sufficient_funds.invoice_id == non_sufficient_funds_object.get('invoice_id')
assert non_sufficient_funds.description == non_sufficient_funds_object.get('description')


def test_find_all_non_sufficient_funds_invoices(session):
"""Test find_all_non_sufficient_funds_invoices."""
invoice_number = '10001'
Expand Down
2 changes: 1 addition & 1 deletion pay-api/tests/utilities/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from faker import Faker

from pay_api.models import (
CfsAccount, Comment, DistributionCode, EFTShortnames, Invoice, InvoiceReference, NonSufficientFundsModel, Payment,
CfsAccount, Comment, DistributionCode, EFTShortnames, Invoice, InvoiceReference, NonSufficientFundsModel, Payment,
PaymentAccount, PaymentLineItem, PaymentTransaction, Receipt, RoutingSlip, Statement, StatementInvoices,
StatementSettings)
from pay_api.utils.constants import DT_SHORT_FORMAT
Expand Down

0 comments on commit 40a4b47

Please sign in to comment.