From 30c30ffb11ae1b75f21f5661d3b9e4f21b07ce44 Mon Sep 17 00:00:00 2001 From: Petr Kalashnikov <pka065@it6100016.klientdrift.uib.no> Date: Thu, 25 Feb 2021 15:28:50 +0100 Subject: [PATCH] Remove redundant test with fixture --- setra_client/models.py | 28 +------- tests/conftest.py | 4 -- tests/fixtures/batch_complete_fixture.json | 79 ---------------------- 3 files changed, 3 insertions(+), 108 deletions(-) delete mode 100644 tests/fixtures/batch_complete_fixture.json diff --git a/setra_client/models.py b/setra_client/models.py index 9dad001..1c14138 100644 --- a/setra_client/models.py +++ b/setra_client/models.py @@ -31,14 +31,10 @@ class BaseModel(pydantic.BaseModel): return cls.from_dict(data) - class Transaction(BaseModel): - id: Optional[str] - voucher_id: Optional[str] - created: Optional[datetime.datetime] account: str amount: float - transdate: Optional[datetime.datetime] + transdate: Optional[datetime.date] curamount: Optional[float] currency: Optional[str] description: str @@ -56,36 +52,18 @@ class Transaction(BaseModel): class Voucher(BaseModel): - id: Optional[str] - batch_id: Optional[str] - created: Optional[datetime.datetime] - voucherdate: Optional[datetime.datetime] + voucherdate: Optional[datetime.date] exref: Optional[str] voucherno: int - voucherno_ubw: Optional[str] - voucherno_ubw_wflow: Optional[str] - vouchertype: Optional[str] transactions: typing.List[Transaction] class Batch(BaseModel): """Model representing a batch, with a list of vouchers (and each voucher has a list of transactions)""" client: str - created: Optional[datetime.datetime] batchid: str period: str interface: str vouchertype: typing.Optional[str] vouchers: typing.List[Voucher] - batch_validated_ok_date: Optional[datetime.datetime] - batch_rejected_code: Optional[str] - sent_date: Optional[datetime.datetime] - http_response_content: Optional[str] - http_response_code: Optional[datetime.datetime] - orderno: Optional[datetime.datetime] - polling_statuscode: Optional[str] - polling_statuscode_date: Optional[datetime.datetime] - getresult_date: Optional[datetime.datetime] - getresult_statuscode: Optional[str] - getresult_logg: Optional[str] - getresult_report: Optional[str] + diff --git a/tests/conftest.py b/tests/conftest.py index 6added8..a8a3e63 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -82,7 +82,3 @@ def batch_with_voucher_fixture(): def batch_fail_fixture(): return load_json_file('batch_fail_fixture.json') - -@pytest.fixture -def batch_complete_fixture(): - return load_json_file('batch_complete_fixture.json') diff --git a/tests/fixtures/batch_complete_fixture.json b/tests/fixtures/batch_complete_fixture.json deleted file mode 100644 index e49a6f7..0000000 --- a/tests/fixtures/batch_complete_fixture.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "created": "2020-01-01T00:00:00Z", - "batchid": "252", - "period": 201902, - "interface": "HB", - "client": "72", - "vouchertype": "3", - "batch_validated_ok_date": null, - "batch_rejected_code": "", - "sent_date": null, - "http_response_content": "", - "http_response_code": null, - "orderno": null, - "polling_statuscode": "1", - "polling_statuscode_date": null, - "getresult_date": null, - "getresult_statuscode": "1", - "getresult_logg": "", - "getresult_report": "", - "vouchers": [ - { - "id": 252, - "batch_id": 252, - "created": "2020-01-01T00:00:00Z", - "voucherdate": "2020-01-01T00:00:00Z", - "exref": "", - "voucherno": 252, - "voucherno_ubw": null, - "voucherno_ubw_wflow": null, - "vouchertype": "HB", - "transactions": [ - { - "id": 3, - "voucher_id": 252, - "created": "2020-01-01T00:00:00Z", - "account": "72", - "amount": 50.0, - "transdate": "2020-01-01T00:00:00Z", - "curamount": 50.0, - "currency": "NOK", - "description": "50 NOK into 72", - "dim1": "", - "dim2": "", - "dim3": "", - "dim4": "", - "dim5": "", - "dim6": "", - "dim7": "", - "sequenceno": 1, - "taxcode": "MVA", - "transtype": "GL", - "extinvref": "" - }, - { - "id": 4, - "voucher_id": 252, - "created": "2020-01-01T00:00:00Z", - "account": "72", - "amount": 50.0, - "transdate": "2020-01-01T00:00:00Z", - "curamount": 50.0, - "currency": "NOK", - "description": "50 NOK into 72", - "dim1": "", - "dim2": "", - "dim3": "", - "dim4": "", - "dim5": "", - "dim6": "", - "dim7": "", - "sequenceno": 1, - "taxcode": "MVA", - "transtype": "GL", - "extinvref": "" - } - ] - } - ] -} \ No newline at end of file -- GitLab