This commit is contained in:
@@ -312,15 +312,22 @@ def test_list_orders_pending_waybill_returns_orders_without_url() -> None:
|
||||
)
|
||||
await _seed_order(
|
||||
repository,
|
||||
order_uuid="not-cdek",
|
||||
order_uuid="cse-pending",
|
||||
provider="cse",
|
||||
provider_order_id="cse-1",
|
||||
)
|
||||
await _seed_order(
|
||||
repository,
|
||||
order_uuid="cse-with-waybill",
|
||||
provider="cse",
|
||||
provider_order_id="cse-2",
|
||||
provider_waybill_id="496-AA-1676378",
|
||||
)
|
||||
|
||||
async with repository.session() as session:
|
||||
orders = await repository.list_orders_pending_waybill(session, limit=10)
|
||||
|
||||
assert [order.order_uuid for order in orders] == ["pending"]
|
||||
assert [order.order_uuid for order in orders] == ["pending", "cse-pending"]
|
||||
|
||||
asyncio.run(_with_repository(run))
|
||||
|
||||
@@ -449,7 +456,7 @@ def test_record_waybill_poll_sets_url_only_when_previously_null() -> None:
|
||||
asyncio.run(_with_repository(run))
|
||||
|
||||
|
||||
def test_list_orders_pending_waybill_email_returns_orders_with_url_and_no_sent_at() -> None:
|
||||
def test_list_orders_pending_waybill_email_returns_ready_orders() -> None:
|
||||
async def run(
|
||||
repository: OrderRepository,
|
||||
_session_factory: async_sessionmaker[AsyncSession],
|
||||
@@ -474,6 +481,19 @@ def test_list_orders_pending_waybill_email_returns_orders_with_url_and_no_sent_a
|
||||
provider_waybill_id="w3",
|
||||
provider_waybill_url="https://cdek.test/3.pdf",
|
||||
)
|
||||
await _seed_order(
|
||||
repository,
|
||||
order_uuid="cse-ready",
|
||||
provider="cse",
|
||||
provider_order_id="cse-o1",
|
||||
provider_waybill_id="496-AA-1676378",
|
||||
)
|
||||
await _seed_order(
|
||||
repository,
|
||||
order_uuid="cse-no-waybill",
|
||||
provider="cse",
|
||||
provider_order_id="cse-o2",
|
||||
)
|
||||
async with repository.session() as session:
|
||||
sent = await repository.get_order_by_order_uuid(session, "already-sent")
|
||||
assert sent is not None
|
||||
@@ -486,7 +506,7 @@ def test_list_orders_pending_waybill_email_returns_orders_with_url_and_no_sent_a
|
||||
session, limit=10
|
||||
)
|
||||
|
||||
assert [order.order_uuid for order in orders] == ["ready"]
|
||||
assert [order.order_uuid for order in orders] == ["ready", "cse-ready"]
|
||||
|
||||
asyncio.run(_with_repository(run))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user