更新
This commit is contained in:
@@ -8,6 +8,8 @@ from pathlib import Path
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
from sqlalchemy import create_engine, inspect, text
|
||||
from sqlalchemy.dialects import mysql
|
||||
from sqlalchemy.schema import CreateTable
|
||||
|
||||
|
||||
BACKEND_DIR = Path(__file__).resolve().parents[1]
|
||||
@@ -24,6 +26,7 @@ from rpa_engine.egress_channels import (
|
||||
resolve_send_channels,
|
||||
)
|
||||
from models.db_migrate import migrate_accounts_table
|
||||
from models.models import Account
|
||||
|
||||
|
||||
class EgressChannelTests(unittest.IsolatedAsyncioTestCase):
|
||||
@@ -98,6 +101,13 @@ class EgressChannelTests(unittest.IsolatedAsyncioTestCase):
|
||||
|
||||
|
||||
class EgressMigrationTests(unittest.TestCase):
|
||||
def test_mysql_accounts_uses_longtext_for_browser_payloads(self):
|
||||
ddl = str(CreateTable(Account.__table__).compile(dialect=mysql.dialect()))
|
||||
|
||||
self.assertIn("cookie_data LONGTEXT", ddl)
|
||||
self.assertIn("im_session_data LONGTEXT", ddl)
|
||||
self.assertIn("qr_code_base64 LONGTEXT", ddl)
|
||||
|
||||
def test_old_accounts_table_receives_egress_columns(self):
|
||||
engine = create_engine("sqlite:///:memory:")
|
||||
with engine.begin() as connection:
|
||||
|
||||
Reference in New Issue
Block a user