Skip to content

Commit

Permalink
Financial item (#116)
Browse files Browse the repository at this point in the history
* Fix view name & parent class

* Add Item resource view for dgfFinancial

* Rename test case

* Remove unneeded initial_bids

* Add test for the dgfFinancial items resource
  • Loading branch information
bdmbdsm authored and leits committed Aug 23, 2018
1 parent 0be0804 commit 866d56e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
13 changes: 9 additions & 4 deletions openprocurement/auctions/dgf/tests/item.py
Expand Up @@ -3,21 +3,26 @@

from openprocurement.auctions.dgf.tests.base import (
BaseAuctionWebTest,
test_bids,
test_financial_auction_data,
)
from openprocurement.auctions.core.tests.items import (
DgfItemsResourceTestMixin,
)


class DgfItemsResourceTest(BaseAuctionWebTest, DgfItemsResourceTestMixin):
class DgfOtherItemsResourceTest(BaseAuctionWebTest, DgfItemsResourceTestMixin):
initial_status = 'active.tendering'
initial_bids = test_bids


class DgfFinancialItemsResourceTest(BaseAuctionWebTest, DgfItemsResourceTestMixin):
initial_status = 'active.tendering'
initial_data = test_financial_auction_data


def suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(DgfItemsResourceTest))
suite.addTest(unittest.makeSuite(DgfOtherItemsResourceTest))
suite.addTest(unittest.makeSuite(DgfFinancialItemsResourceTest))

return suite

Expand Down
14 changes: 14 additions & 0 deletions openprocurement/auctions/dgf/views/financial/item.py
@@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
from openprocurement.auctions.core.utils import opresource
from openprocurement.auctions.core.endpoints import ENDPOINTS
from openprocurement.auctions.dgf.views.other.item import AuctionItemResource


@opresource(
name='dgfFinancialAssets:Auction Items',
collection_path=ENDPOINTS['items'],
path=ENDPOINTS['item'],
auctionsprocurementMethodType="dgfFinancialAssets",
description="Auction items")
class AuctionItemResource(AuctionItemResource):
pass
4 changes: 2 additions & 2 deletions openprocurement/auctions/dgf/views/other/item.py
Expand Up @@ -10,7 +10,7 @@
from openprocurement.auctions.core.validation import (
validate_item_rectification_period,
)
from openprocurement.auctions.core.views.mixins import AuctionLotResource
from openprocurement.auctions.core.utils import APIResource
from openprocurement.auctions.core.endpoints import ENDPOINTS
from openprocurement.auctions.dgf.validation import (
validate_item_data,
Expand All @@ -24,7 +24,7 @@
path=ENDPOINTS['item'],
auctionsprocurementMethodType="dgfOtherAssets",
description="Auction items")
class AuctionLotResource(AuctionLotResource):
class AuctionItemResource(APIResource):

@json_view(
content_type="application/json",
Expand Down

0 comments on commit 866d56e

Please sign in to comment.