# -*- coding: utf-8 -*-
import unittest
from openprocurement.tender.openeu.constants import TENDERING_DAYS
from openprocurement.tender.esco.tests.base import (
    test_tender_data, test_lots, test_bids,
    BaseESCOWebTest, BaseESCOContentWebTest,
)
from openprocurement.api.tests.base import snitch

from openprocurement.tender.belowthreshold.tests.tender import TenderResourceTestMixin
from openprocurement.tender.belowthreshold.tests.tender_blanks import (
    #TenderProcessTest
    invalid_tender_conditions,
    #TenderResourceTest
    guarantee,
)

from openprocurement.tender.openua.tests.tender import TenderUAResourceTestMixin

from openprocurement.tender.openeu.tests.tender_blanks import (
    #TenderProcessTest
    one_bid_tender,
    unsuccessful_after_prequalification_tender,
    one_qualificated_bid_tender,
    multiple_bidders_tender,
    lost_contract_for_active_award,
    #TenderResourceTest
    invalid_bid_tender_lot,
)

from openprocurement.tender.esco.tests.tender_blanks import (
    #TenderESCOTest
    simple_add_tender,
    tender_value,
    tender_min_value,
    tender_minimal_step_invalid,
    tender_yearlyPaymentsPercentageRange_invalid,
    #TestTenderEU
    create_tender_invalid,
    patch_tender,
    tender_with_nbu_discount_rate,
    invalid_bid_tender_features,
    create_tender_generated,
)


class TenderESCOTest(BaseESCOWebTest):
    initial_auth = ('Basic', ('broker', ''))
    initial_data = test_tender_data

    test_simple_add_tender = snitch(simple_add_tender)
    test_tender_value = snitch(tender_value)
    test_tender_min_value = snitch(tender_min_value)
    test_tender_minimal_step_invalid = snitch(tender_minimal_step_invalid)
    test_tender_yearlyPaymentsPercentageRange_invalid = snitch(tender_yearlyPaymentsPercentageRange_invalid)


class TestTenderEU(BaseESCOContentWebTest, TenderResourceTestMixin, TenderUAResourceTestMixin):
    """ ESCO tender test """
    initialize_initial_data = False
    test_tender_data['submissionMethodDetails'] = "quick(mode:no-auction)"  # TODO: remove this line after adding auction
    initial_data = test_tender_data
    # for passing test from TenderUAResourceTestMixin
    initial_data['minValue'] = {"amount": 0}
    test_lots_data = test_lots
    test_bids_data = test_bids
    tender_period_duration = TENDERING_DAYS

    test_tender_with_nbu_discount_rate = snitch(tender_with_nbu_discount_rate)
    test_create_tender_invalid = snitch(create_tender_invalid)
    test_create_tender_generated = snitch(create_tender_generated)
    test_patch_tender = snitch(patch_tender)
    test_guarantee = snitch(guarantee)
    test_invalid_bid_tender_features = snitch(invalid_bid_tender_features)
    test_invalid_bid_tender_lot = snitch(invalid_bid_tender_lot)

    # TODO: remove this test after adding auction
    from openprocurement.tender.esco.tests.tender_blanks import tender_submission_method_details_no_auction_only
    test_tender_submission_method_details_no_auction_only = snitch(tender_submission_method_details_no_auction_only)


class TestTenderEUProcess(BaseESCOContentWebTest):

    initialize_initial_data = False
    initial_data = test_tender_data
    test_bids_data = test_bids

    test_invalid_tender_conditions = snitch(invalid_tender_conditions)
    test_one_bid_tender = snitch(one_bid_tender)
    test_unsuccessful_after_prequalification_tender = snitch(unsuccessful_after_prequalification_tender)
    test_one_qualificated_bid_tender = snitch(one_qualificated_bid_tender)
    test_multiple_bidders_tender = snitch(multiple_bidders_tender)
    test_lost_contract_for_active_award = snitch(lost_contract_for_active_award)


def suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(TenderESCOTest))
    suite.addTest(unittest.makeSuite(TestTenderEU))
    suite.addTest(unittest.makeSuite(TestTenderEUProcess))
    return suite


if __name__ == '__main__':
    unittest.main(defaultTest='suite')

@@ -1164,24 +1164,65 @@
 ge_invalid,%0A
+    items_without_deliveryDate_quantity,%0A
     #TestTen
@@ -1227,16 +1227,16 @@
 enderEU%0A
-
     crea
@@ -1492,16 +1492,47 @@
 der_data
+%0A    test_bids_data = test_bids
 %0A%0A    te
@@ -1745,32 +1745,32 @@
 l_step_invalid)%0A
-
     test_tender_
@@ -1862,16 +1862,107 @@
 nvalid)%0A
+    test_items_without_deliveryDate_quantity = snitch(items_without_deliveryDate_quantity)%0A
 %0A%0Aclass 

Add missing test call for items