mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-04 21:15:22 +02:00
* feat: server side search API (#2112) * refactor repository_recipes filter building * add food filter to recipe repository page_all * fix query type annotations * working search * add tests and make sure title matches are ordered correctly * remove instruction matching again * fix formatting and small issues * fix another linting error * make search test no rely on actual words * fix failing postgres compiled query * revise incorrectly ordered migration * automatically extract latest migration version * test migration orderes * run type generators * new search function * wip: new search page * sortable field options * fix virtual scroll issue * fix search casing bug * finalize search filters/sorts * remove old composable * fix type errors --------- Co-authored-by: Sören <fleshgolem@gmx.net>
This commit is contained in:
parent
fc105dcebc
commit
71f8c1066a
36 changed files with 1057 additions and 822 deletions
|
@ -1,14 +1,47 @@
|
|||
import pytest
|
||||
import pathlib
|
||||
|
||||
# Test that alembic revisions are applicable and result in the current database
|
||||
# See https://github.com/sqlalchemy/alembic/issues/724 for inspiration
|
||||
from pydantic import BaseModel
|
||||
|
||||
from tests.utils.alembic_reader import ALEMBIC_MIGRATIONS, import_file
|
||||
|
||||
|
||||
@pytest.mark.skip("TODO: Implement")
|
||||
def test_alembic_revisions_are_applicable():
|
||||
pass
|
||||
class AlembicMigration(BaseModel):
|
||||
path: pathlib.Path
|
||||
revision: str | None
|
||||
down_revision: str | None
|
||||
|
||||
|
||||
@pytest.mark.skip("TODO: Implement")
|
||||
def test_alembic_revisions_are_up_to_date():
|
||||
pass
|
||||
def test_alembic_revisions_are_in_order() -> None:
|
||||
# read all files
|
||||
paths = sorted(ALEMBIC_MIGRATIONS.glob("*.py"))
|
||||
|
||||
# convert to sorted list of AlembicMigration
|
||||
migrations: list[AlembicMigration] = []
|
||||
|
||||
for path in paths:
|
||||
mod = import_file("alembic_version", path)
|
||||
|
||||
revision = getattr(mod, "revision", None)
|
||||
down_revision = getattr(mod, "down_revision", None)
|
||||
|
||||
migrations.append(
|
||||
AlembicMigration(
|
||||
path=path,
|
||||
revision=revision,
|
||||
down_revision=down_revision,
|
||||
)
|
||||
)
|
||||
|
||||
# step through each migration and check
|
||||
# - revision is in order
|
||||
# - down_revision is in order
|
||||
# - down_revision is the previous revision
|
||||
last = None
|
||||
for migration in migrations:
|
||||
if last is not None:
|
||||
assert (
|
||||
last.revision == migration.down_revision
|
||||
), f"{last.revision} != {migration.down_revision} for {migration.path}"
|
||||
|
||||
last = migration
|
||||
last = migration
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue