# Path: openprocurement/tender/openeu/constants.py
# TENDERING_DAYS = 30
# 
# TENDERING_DURATION = timedelta(days=TENDERING_DAYS)
# 
# QUESTIONS_STAND_STILL = timedelta(days=10)
# 
# COMPLAINT_STAND_STILL = timedelta(days=10)


import os
from datetime import datetime, timedelta
from openprocurement.api.constants import SANDBOX_MODE
from openprocurement.tender.openua.tests.base import (
    BaseTenderUAWebTest as BaseBaseTenderWebTest
)
from openprocurement.api.utils import apply_data_patch, get_now
from openprocurement.tender.openeu.constants import (
    TENDERING_DAYS,
    TENDERING_DURATION,
    QUESTIONS_STAND_STILL,
    COMPLAINT_STAND_STILL
)
                            }
                        }
                        for i in self.initial_lots
                    ]
                })
        if extra:
            data.update(extra)
        tender.update(apply_data_patch(tender, data))
        self.db.save(tender)

    def set_status(self, status, extra=None):
        tender = self.db.get(self.tender_id)

        def activate_bids():
            if tender.get('bids', ''):
                bids = tender['bids']
                for bid in bids:
                    if bid['status'] == 'pending':
                        bid.update({'status': 'active'})
                data.update({'bids': bids})

        data = {'status': status}
        if status == 'active.tendering':
            data.update({
                "enquiryPeriod": {
                    "startDate": (now - timedelta(days=1)).isoformat(),
                    "endDate": (now + TENDERING_DURATION - QUESTIONS_STAND_STILL).isoformat()
                },
                "tenderPeriod": {
                    "startDate": (now - timedelta(days=1)).isoformat(),

# Path: openprocurement/tender/openeu/constants.py
# TENDERING_DAYS = 30
# 
# TENDERING_DURATION = timedelta(days=TENDERING_DAYS)
# 
# QUESTIONS_STAND_STILL = timedelta(days=10)
# 
# COMPLAINT_STAND_STILL = timedelta(days=10)


# Path: openprocurement/tender/openeu/tests/base.py
import os
from datetime import datetime, timedelta
from openprocurement.api.constants import SANDBOX_MODE
from openprocurement.tender.openua.tests.base import (
    BaseTenderUAWebTest as BaseBaseTenderWebTest
)
from openprocurement.api.utils import apply_data_patch, get_now
from openprocurement.tender.openeu.constants import (
    TENDERING_DAYS,
    TENDERING_DURATION,
    QUESTIONS_STAND_STILL,
    COMPLAINT_STAND_STILL
)

                            }
                        }
                        for i in self.initial_lots
                    ]
                })
        if extra:
            data.update(extra)
        tender.update(apply_data_patch(tender, data))
        self.db.save(tender)

    def set_status(self, status, extra=None):
        tender = self.db.get(self.tender_id)

        def activate_bids():
            if tender.get('bids', ''):
                bids = tender['bids']
                for bid in bids:
                    if bid['status'] == 'pending':
                        bid.update({'status': 'active'})
                data.update({'bids': bids})

        data = {'status': status}
        if status == 'active.tendering':
            data.update({
                "enquiryPeriod": {
                    "startDate": (now - timedelta(days=1)).isoformat(),
                    "endDate": (now + TENDERING_DURATION - QUESTIONS_STAND_STILL).isoformat()
                },
                "tenderPeriod": {
                    "startDate": (now - timedelta(days=1)).isoformat(),

                    "endDate": (now + TENDERING_DURATION).isoformat()