# Path: openprocurement/tender/openua/tests/base.py
# class BaseTenderUAWebTest(BaseTenderWebTest):
# class BaseTenderUAContentWebTest(BaseTenderUAWebTest):
#     def go_to_enquiryPeriod_end(self):
#     def set_status(self, status, extra=None):
#     def setUp(self):


from copy import deepcopy
from datetime import timedelta
from openprocurement.tender.belowthreshold.tests.base import (
    test_organization,
    now
)
from openprocurement.tender.openua.tests.base import (
    test_bids
)
    self.app.authorization = ('Basic', ('chronograph', ''))
    response = self.app.patch_json('/tenders/{}'.format(self.tender_id), {"data": {"id": self.tender_id}})
    self.assertEqual(response.json['data']['status'], 'unsuccessful')
    response = self.app.get('/tenders/{}/bids'.format(self.tender_id))
    self.assertEqual(response.json['data'], [])


def draft2_bids(self):
    response = self.app.post_json('/tenders/{}/bids'.format(
        self.tender_id), {'data': {'selfEligible': True, 'selfQualified': True, 'status': 'draft',
                                   'tenderers': [self.author_data], "value": {"amount": 500}}})
    response = self.app.post_json('/tenders/{}/bids'.format(
        self.tender_id), {'data': {'selfEligible': True, 'selfQualified': True, 'status': 'draft',
                                   'tenderers': [self.author_data], "value": {"amount": 500}}})
    self.assertEqual(response.status, '201 Created')
    self.assertEqual(response.content_type, 'application/json')

    self.set_status('active.auction')
    self.set_status('active.auction', {"auctionPeriod": {"startDate": None}, 'status': 'active.tendering'})
    self.app.authorization = ('Basic', ('chronograph', ''))
    response = self.app.patch_json('/tenders/{}'.format(self.tender_id), {"data": {"id": self.tender_id}})
    self.assertEqual(response.json['data']['status'], 'unsuccessful')
    response = self.app.get('/tenders/{}/bids'.format(self.tender_id))
    self.assertEqual(response.json['data'], [])


def bids_invalidation_on_tender_change(self):
    bids_access = {}

    # submit bids

# Path: openprocurement/tender/openua/tests/base.py
# class BaseTenderUAWebTest(BaseTenderWebTest):
# class BaseTenderUAContentWebTest(BaseTenderUAWebTest):
#     def go_to_enquiryPeriod_end(self):
#     def set_status(self, status, extra=None):
#     def setUp(self):


# Path: openprocurement/tender/openua/tests/bid_blanks.py
from copy import deepcopy
from datetime import timedelta
from openprocurement.tender.belowthreshold.tests.base import (
    test_organization,
    now
)
from openprocurement.tender.openua.tests.base import (
    test_bids
)

    self.app.authorization = ('Basic', ('chronograph', ''))
    response = self.app.patch_json('/tenders/{}'.format(self.tender_id), {"data": {"id": self.tender_id}})
    self.assertEqual(response.json['data']['status'], 'unsuccessful')
    response = self.app.get('/tenders/{}/bids'.format(self.tender_id))
    self.assertEqual(response.json['data'], [])


def draft2_bids(self):
    response = self.app.post_json('/tenders/{}/bids'.format(
        self.tender_id), {'data': {'selfEligible': True, 'selfQualified': True, 'status': 'draft',
                                   'tenderers': [self.author_data], "value": {"amount": 500}}})
    response = self.app.post_json('/tenders/{}/bids'.format(
        self.tender_id), {'data': {'selfEligible': True, 'selfQualified': True, 'status': 'draft',
                                   'tenderers': [self.author_data], "value": {"amount": 500}}})
    self.assertEqual(response.status, '201 Created')
    self.assertEqual(response.content_type, 'application/json')

    self.set_status('active.auction')
    self.set_status('active.auction', {"auctionPeriod": {"startDate": None}, 'status': 'active.tendering'})
    self.app.authorization = ('Basic', ('chronograph', ''))
    response = self.app.patch_json('/tenders/{}'.format(self.tender_id), {"data": {"id": self.tender_id}})
    self.assertEqual(response.json['data']['status'], 'unsuccessful')
    response = self.app.get('/tenders/{}/bids'.format(self.tender_id))
    self.assertEqual(response.json['data'], [])


def bids_invalidation_on_tender_change(self):
    bids_access = {}

    # submit bids

    for data in test_bids: