feat: миграция с булевых переменных на status для target_channel
This commit is contained in:
@@ -29,7 +29,8 @@ async def test_connect_new_channel_success(usecases: usecase.Usecase, mock_datab
|
||||
|
||||
assert result.telegram_id == -1001234567890
|
||||
assert result.title == 'Test Channel'
|
||||
assert result.is_active is True
|
||||
assert result.status == domain.TargetChannelStatus.ACTIVE
|
||||
assert result.is_active is True # проверка обратной совместимости
|
||||
|
||||
# Проверяем, что канал сохранён
|
||||
channel = await mock_database.get_target_channel(user.id, telegram_id=-1001234567890)
|
||||
@@ -128,14 +129,14 @@ async def test_get_user_target_channels(usecases: usecase.Usecase, mock_database
|
||||
title='Channel 1',
|
||||
username='channel1',
|
||||
user_id=user.id,
|
||||
is_active=True,
|
||||
status=domain.TargetChannelStatus.ACTIVE,
|
||||
)
|
||||
channel2 = domain.TargetChannel(
|
||||
telegram_id=-1001234567891,
|
||||
title='Channel 2',
|
||||
username='channel2',
|
||||
user_id=user.id,
|
||||
is_active=True,
|
||||
status=domain.TargetChannelStatus.ACTIVE,
|
||||
)
|
||||
await mock_database.upsert_target_channel(channel1)
|
||||
await mock_database.upsert_target_channel(channel2)
|
||||
@@ -156,7 +157,7 @@ async def test_disconnect_target_channel(usecases: usecase.Usecase, mock_databas
|
||||
title='Test Channel',
|
||||
username='testchannel',
|
||||
user_id=user.id,
|
||||
is_active=True,
|
||||
status=domain.TargetChannelStatus.ACTIVE,
|
||||
)
|
||||
await mock_database.upsert_target_channel(channel)
|
||||
|
||||
@@ -165,4 +166,4 @@ async def test_disconnect_target_channel(usecases: usecase.Usecase, mock_databas
|
||||
# Проверяем, что канал стал неактивным
|
||||
updated_channel = await mock_database.get_target_channel(user.id, channel_id=channel.id)
|
||||
assert updated_channel is not None
|
||||
assert updated_channel.is_active is False
|
||||
assert updated_channel.status == domain.TargetChannelStatus.INACTIVE
|
||||
|
||||
Reference in New Issue
Block a user