feat: add customer travel records and browse history
This commit is contained in:
1 parent
0139fe6382
commit
6d9a546918
79 files changed
+12362
-112
No files matched your search
@@ -0,0 +1,23 @@
|
||||
from importlib.util import module_from_spec, spec_from_file_location
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
MIGRATION_PATH = Path(__file__).parents[1] / "alembic" / "versions" / "0036_customer_browse_history.py"
|
||||
SPEC = spec_from_file_location("customer_browse_history_migration", MIGRATION_PATH)
|
||||
assert SPEC and SPEC.loader
|
||||
MIGRATION = module_from_spec(SPEC)
|
||||
SPEC.loader.exec_module(MIGRATION)
|
||||
|
||||
|
||||
def test_customer_browse_history_migration_is_chained_after_current_head():
|
||||
assert MIGRATION.revision == "0036_customer_browse_history"
|
||||
assert MIGRATION.down_revision == "0035_concierge_details_jsonb"
|
||||
|
||||
|
||||
def test_customer_browse_history_table_and_indexes_are_created_only_when_missing():
|
||||
assert MIGRATION.should_create_table(set()) is True
|
||||
assert MIGRATION.should_create_table({MIGRATION.TABLE_NAME}) is False
|
||||
assert MIGRATION.CUSTOMER_HISTORY_INDEXES == {
|
||||
"ix_CustomerBrowseHistory_customerId",
|
||||
"ix_CustomerBrowseHistory_customer_visitedAt",
|
||||
}
|
||||
Reference in new issue
Block a user