mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 13:35:23 +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
|
@ -2,10 +2,7 @@ import json
|
|||
|
||||
from mealie.core.config import get_app_settings
|
||||
from mealie.services.backups_v2.alchemy_exporter import AlchemyExporter
|
||||
|
||||
ALEMBIC_VERSIONS = [
|
||||
{"version_num": "ff5f73b01a7a"},
|
||||
]
|
||||
from tests.utils.alembic_reader import alembic_versions
|
||||
|
||||
|
||||
def test_alchemy_exporter():
|
||||
|
@ -13,16 +10,16 @@ def test_alchemy_exporter():
|
|||
exporter = AlchemyExporter(settings.DB_URL)
|
||||
data = exporter.dump()
|
||||
|
||||
assert data["alembic_version"] == ALEMBIC_VERSIONS
|
||||
assert data["alembic_version"] == alembic_versions()
|
||||
assert json.dumps(data, indent=4) # Make sure data is json-serializable
|
||||
|
||||
|
||||
def test_validate_schemas():
|
||||
schema = {
|
||||
"alembic_version": ALEMBIC_VERSIONS,
|
||||
"alembic_version": alembic_versions(),
|
||||
}
|
||||
match = {
|
||||
"alembic_version": ALEMBIC_VERSIONS,
|
||||
"alembic_version": alembic_versions(),
|
||||
}
|
||||
|
||||
invalid_version = {
|
||||
|
@ -33,7 +30,7 @@ def test_validate_schemas():
|
|||
assert not AlchemyExporter.validate_schemas(schema, invalid_version)
|
||||
|
||||
schema_with_tables = {
|
||||
"alembic_version": ALEMBIC_VERSIONS,
|
||||
"alembic_version": alembic_versions(),
|
||||
"recipes": [
|
||||
{
|
||||
"id": 1,
|
||||
|
@ -41,7 +38,7 @@ def test_validate_schemas():
|
|||
],
|
||||
}
|
||||
match_with_tables = {
|
||||
"alembic_version": ALEMBIC_VERSIONS,
|
||||
"alembic_version": alembic_versions(),
|
||||
"recipes": [
|
||||
{
|
||||
"id": 2,
|
||||
|
@ -50,3 +47,5 @@ def test_validate_schemas():
|
|||
}
|
||||
|
||||
assert AlchemyExporter.validate_schemas(schema_with_tables, match_with_tables)
|
||||
assert AlchemyExporter.validate_schemas(schema_with_tables, match_with_tables)
|
||||
assert AlchemyExporter.validate_schemas(schema_with_tables, match_with_tables)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue