Skip to content

Commit

Permalink
Merge pull request #25 from Scandie/a896225552440432_ci_test_fix
Browse files Browse the repository at this point in the history
A896225552440432 ci test fix
  • Loading branch information
leits committed Nov 5, 2018
2 parents 2856159 + 653edb0 commit 2ac41e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion openprocurement/chronograph/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def planning_auction(auction, mapper, start, db, quick=False, lot_id=None):
calendar = get_calendar(db)
streams = manager.get_streams(db)
start += timedelta(hours=1)
if start.time() > WORKING_DAY_START:
if start.time() > manager.working_day_start:
nextDate = start.date() + timedelta(days=1)
else:
nextDate = start.date()
Expand Down
7 changes: 4 additions & 3 deletions openprocurement/chronograph/tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from iso8601 import parse_date

from openprocurement.chronograph import TZ
from openprocurement.chronograph.constants import DEFAULT_STREAMS_DOC
from openprocurement.chronograph.constants import DEFAULT_STREAMS_DOC, WORKING_DAY_START
from openprocurement.chronograph.tests.utils import update_json
from openprocurement.chronograph.scheduler import planning_auction
from openprocurement.chronograph.tests.base import BaseWebTest, BaseAuctionWebTest
Expand Down Expand Up @@ -578,14 +578,15 @@ def test_reschedule_auction(self):

response = requests.get('{}/{}'.format(self.app.app.registry.full_url, self.auction_id))
auction = response.json()['data']
date_time = TZ.localize(datetime.combine(datetime.now().date(), WORKING_DAY_START))
if self.initial_lots:
self.assertIn('auctionPeriod', auction['lots'][0])
auctionPeriod = auction['lots'][0]['auctionPeriod']['startDate']
auction['lots'][0]['auctionPeriod']['startDate'] = (datetime.now(TZ) - timedelta(hours=1)).isoformat()
auction['lots'][0]['auctionPeriod']['startDate'] = date_time.isoformat()
else:
self.assertIn('auctionPeriod', auction)
auctionPeriod = auction['auctionPeriod']['startDate']
auction['auctionPeriod']['startDate'] = (datetime.now(TZ) - timedelta(hours=1)).isoformat()
auction['auctionPeriod']['startDate'] = date_time.isoformat()
update_json(self.api, 'auction', self.auction_id, {"data": auction})
response = requests.patch('{}/{}'.format(self.app.app.registry.full_url, self.auction_id), {
'data': {"id": "f547ece35436484e8656a2988fb52a44"}})
Expand Down

0 comments on commit 2ac41e8

Please sign in to comment.