piccolo 1.15.0__tar.gz → 1.17.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {piccolo-1.15.0 → piccolo-1.17.0}/PKG-INFO +1 -1
- piccolo-1.17.0/piccolo/__init__.py +1 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/new.py +2 -2
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/main.py.jinja +4 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/auto/migration_manager.py +22 -1
- piccolo-1.17.0/piccolo/testing/test_case.py +120 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo.egg-info/PKG-INFO +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo.egg-info/SOURCES.txt +2 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/auto/test_migration_manager.py +36 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_array.py +2 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_bigint.py +2 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_boolean.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_bytea.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_choices.py +2 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_date.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_double_precision.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_interval.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_json.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_jsonb.py +2 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_numeric.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_primary_key.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_readable.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_real.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_reference.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_reserved_column_names.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_smallint.py +2 -2
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_time.py +2 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_timestamp.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_timestamptz.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_uuid.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_varchar.py +2 -2
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/functions/base.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/functions/test_datetime.py +2 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/functions/test_math.py +1 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_refresh.py +2 -1
- piccolo-1.17.0/tests/testing/test_test_case.py +65 -0
- piccolo-1.15.0/piccolo/__init__.py +0 -1
- {piccolo-1.15.0 → piccolo-1.17.0}/LICENSE +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/README.md +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/app/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/app/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/app/commands/new.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/app/commands/show_all.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/app/commands/templates/piccolo_app.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/app/commands/templates/tables.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/app/piccolo_app.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/README.md.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/_esmerald_app.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/_fastapi_app.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/_lilya_app.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/_litestar_app.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/_starlette_app.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/app.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/conftest.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/home/__init__.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/home/_blacksheep_endpoints.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/home/_esmerald_endpoints.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/home/_lilya_endpoints.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/home/_litestar_endpoints.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/home/_starlette_endpoints.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/home/endpoints.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/home/piccolo_app.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/home/piccolo_migrations/README.md +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/home/tables.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/home/templates/base.html.jinja_raw +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/home/templates/home.html.jinja_raw +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/piccolo_conf.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/piccolo_conf_test.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/requirements.txt.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/static/favicon.ico +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/static/main.css +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/piccolo_app.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/fixtures/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/fixtures/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/fixtures/commands/dump.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/fixtures/commands/load.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/fixtures/commands/shared.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/fixtures/piccolo_app.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/meta/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/meta/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/meta/commands/version.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/meta/piccolo_app.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/auto/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/auto/diffable_table.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/auto/operations.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/auto/schema_differ.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/auto/schema_snapshot.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/auto/serialisation.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/auto/serialisation_legacy.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/commands/backwards.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/commands/base.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/commands/check.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/commands/clean.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/commands/forwards.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/commands/new.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/commands/templates/migration.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/piccolo_app.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/migrations/tables.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/playground/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/playground/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/playground/commands/run.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/playground/piccolo_app.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/project/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/project/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/project/commands/new.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/project/commands/templates/piccolo_conf.py.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/project/piccolo_app.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/schema/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/schema/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/schema/commands/exceptions.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/schema/commands/generate.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/schema/commands/graph.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/schema/commands/templates/graphviz.dot.jinja +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/schema/piccolo_app.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/shell/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/shell/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/shell/commands/run.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/shell/piccolo_app.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/sql_shell/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/sql_shell/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/sql_shell/commands/run.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/sql_shell/piccolo_app.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/tester/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/tester/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/tester/commands/run.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/tester/piccolo_app.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/user/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/user/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/user/commands/change_password.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/user/commands/change_permissions.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/user/commands/create.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/user/commands/list.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/user/piccolo_app.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/user/piccolo_migrations/2019-11-14T21-52-21.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/user/piccolo_migrations/2020-06-11T21-38-55.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/user/piccolo_migrations/2021-04-30T16-14-15.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/user/piccolo_migrations/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/user/tables.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/base.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/choices.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/column_types.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/combination.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/defaults/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/defaults/base.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/defaults/date.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/defaults/interval.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/defaults/time.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/defaults/timestamp.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/defaults/timestamptz.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/defaults/uuid.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/indexes.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/m2m.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/operators/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/operators/base.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/operators/comparison.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/operators/math.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/operators/string.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/readable.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/columns/reference.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/conf/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/conf/apps.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/custom_types.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/engine/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/engine/base.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/engine/cockroach.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/engine/exceptions.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/engine/finder.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/engine/postgres.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/engine/sqlite.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/main.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/py.typed +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/base.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/functions/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/functions/aggregate.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/functions/base.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/functions/datetime.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/functions/math.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/functions/string.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/functions/type_conversion.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/alter.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/count.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/create.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/create_index.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/delete.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/drop_index.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/exists.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/indexes.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/insert.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/objects.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/raw.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/refresh.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/select.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/table_exists.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/methods/update.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/mixins.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/query/proxy.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/querystring.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/schema.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/table.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/table_reflection.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/testing/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/testing/model_builder.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/testing/random_builder.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/utils/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/utils/dictionary.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/utils/encoding.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/utils/graphlib/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/utils/graphlib/_graphlib.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/utils/lazy_loader.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/utils/list.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/utils/naming.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/utils/objects.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/utils/printing.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/utils/pydantic.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/utils/repr.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/utils/sql_values.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/utils/sync.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo/utils/warnings.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo.egg-info/dependency_links.txt +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo.egg-info/entry_points.txt +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo.egg-info/requires.txt +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/piccolo.egg-info/top_level.txt +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/profiling/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/profiling/run_profile.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/pyproject.toml +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/setup.cfg +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/setup.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/app/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/app/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/app/commands/test_new.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/app/commands/test_show_all.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/asgi/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/asgi/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/asgi/commands/test_new.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/fixtures/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/fixtures/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/fixtures/commands/test_dump_load.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/fixtures/commands/test_shared.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/meta/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/meta/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/meta/commands/test_version.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/auto/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/auto/integration/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/auto/integration/test_migrations.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/auto/test_diffable_table.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/auto/test_schema_differ.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/auto/test_schema_snapshot.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/auto/test_serialisation.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/commands/test_base.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/commands/test_check.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/commands/test_clean.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/commands/test_forwards_backwards.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/commands/test_migrations/2020-03-31T20-38-22.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/commands/test_migrations/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/commands/test_new.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/migrations/test_migration.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/project/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/project/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/project/commands/test_new.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/schema/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/shell/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/shell/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/shell/commands/test_run.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/sql_shell/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/sql_shell/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/sql_shell/commands/test_run.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/tester/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/user/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/user/commands/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/user/commands/test_change_password.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/user/commands/test_change_permissions.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/user/commands/test_create.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/user/commands/test_list.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/apps/user/test_tables.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/m2m/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/m2m/base.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/m2m/test_m2m.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/m2m/test_m2m_schema.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_base.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_combination.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_db_column_name.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_defaults.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/columns/test_get_sql_value.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/conf/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/conf/example.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/conf/test_apps.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/engine/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/engine/test_extra_nodes.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/engine/test_logging.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/engine/test_nested_transaction.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/engine/test_pool.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/engine/test_transaction.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/engine/test_version_parsing.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/example_apps/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/example_apps/mega/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/example_apps/mega/piccolo_app.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/example_apps/mega/piccolo_migrations/2021-09-20T21-23-25-698988.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/example_apps/mega/piccolo_migrations/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/example_apps/mega/tables.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/example_apps/music/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/example_apps/music/piccolo_app.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/example_apps/music/tables.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/example_apps/music/tables_detailed.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/functions/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/functions/test_functions.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/functions/test_string.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/functions/test_type_conversion.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/mixins/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/mixins/test_columns_delegate.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/mixins/test_order_by_delegate.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/test_await.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/test_camelcase.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/test_freeze.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/test_gather.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/test_querystring.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/query/test_slots.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/instance/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/instance/test_create.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/instance/test_get_related.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/instance/test_get_related_readable.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/instance/test_instantiate.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/instance/test_remove.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/instance/test_save.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/instance/test_to_dict.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_all_columns.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_alter.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_batch.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_callback.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_constructor.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_count.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_create.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_create_db_tables.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_create_table_class.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_delete.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_drop_db_tables.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_exists.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_from_dict.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_indexes.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_inheritance.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_insert.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_join.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_join_on.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_metaclass.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_objects.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_output.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_raw.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_ref.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_repr.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_select.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_str.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_table_exists.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/table/test_update.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/test_main.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/test_schema.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/testing/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/testing/test_model_builder.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/testing/test_random_builder.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/utils/__init__.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/utils/test_dictionary.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/utils/test_encoding.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/utils/test_lazy_loader.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/utils/test_list.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/utils/test_naming.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/utils/test_printing.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/utils/test_pydantic.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/utils/test_sql_values.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/utils/test_sync.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/utils/test_table_reflection.py +0 -0
- {piccolo-1.15.0 → piccolo-1.17.0}/tests/utils/test_warnings.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__VERSION__ = "1.17.0"
|
@@ -9,10 +9,10 @@ import colorama
|
|
9
9
|
from jinja2 import Environment, FileSystemLoader
|
10
10
|
|
11
11
|
TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), "templates/app/")
|
12
|
-
SERVERS = ["uvicorn", "Hypercorn"]
|
12
|
+
SERVERS = ["uvicorn", "Hypercorn", "granian"]
|
13
13
|
ROUTER_DEPENDENCIES = {
|
14
14
|
"starlette": ["starlette"],
|
15
|
-
"fastapi": ["fastapi>=0.
|
15
|
+
"fastapi": ["fastapi>=0.112.1"],
|
16
16
|
"blacksheep": ["blacksheep"],
|
17
17
|
"litestar": ["litestar"],
|
18
18
|
"esmerald": ["esmerald"],
|
@@ -130,11 +130,27 @@ class AlterColumnCollection:
|
|
130
130
|
AsyncFunction = t.Callable[[], t.Coroutine]
|
131
131
|
|
132
132
|
|
133
|
+
class SkippedTransaction:
|
134
|
+
async def __aenter__(self):
|
135
|
+
print("Automatic transaction disabled")
|
136
|
+
|
137
|
+
async def __aexit__(self, *args, **kwargs):
|
138
|
+
pass
|
139
|
+
|
140
|
+
|
133
141
|
@dataclass
|
134
142
|
class MigrationManager:
|
135
143
|
"""
|
136
144
|
Each auto generated migration returns a MigrationManager. It contains
|
137
145
|
all of the schema changes that migration wants to make.
|
146
|
+
|
147
|
+
:param wrap_in_transaction:
|
148
|
+
By default, the migration is wrapped in a transaction, so if anything
|
149
|
+
fails, the whole migration will get rolled back. You can disable this
|
150
|
+
behaviour if you want - for example, in a manual migration you might
|
151
|
+
want to create the transaction yourself (perhaps you're using
|
152
|
+
savepoints), or you may want multiple transactions.
|
153
|
+
|
138
154
|
"""
|
139
155
|
|
140
156
|
migration_id: str = ""
|
@@ -166,6 +182,7 @@ class MigrationManager:
|
|
166
182
|
default_factory=list
|
167
183
|
)
|
168
184
|
fake: bool = False
|
185
|
+
wrap_in_transaction: bool = True
|
169
186
|
|
170
187
|
def add_table(
|
171
188
|
self,
|
@@ -935,7 +952,11 @@ class MigrationManager:
|
|
935
952
|
if not engine:
|
936
953
|
raise Exception("Can't find engine")
|
937
954
|
|
938
|
-
async with
|
955
|
+
async with (
|
956
|
+
engine.transaction()
|
957
|
+
if self.wrap_in_transaction
|
958
|
+
else SkippedTransaction()
|
959
|
+
):
|
939
960
|
if not self.preview:
|
940
961
|
if direction == "backwards":
|
941
962
|
raw_list = self.raw_backwards
|
@@ -0,0 +1,120 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
import typing as t
|
4
|
+
from unittest import IsolatedAsyncioTestCase, TestCase
|
5
|
+
|
6
|
+
from piccolo.engine import Engine, engine_finder
|
7
|
+
from piccolo.table import (
|
8
|
+
Table,
|
9
|
+
create_db_tables,
|
10
|
+
create_db_tables_sync,
|
11
|
+
drop_db_tables,
|
12
|
+
drop_db_tables_sync,
|
13
|
+
)
|
14
|
+
|
15
|
+
|
16
|
+
class TableTest(TestCase):
|
17
|
+
"""
|
18
|
+
Identical to :class:`AsyncTableTest <piccolo.testing.test_case.AsyncTableTest>`,
|
19
|
+
except it only work for sync tests. Only use this if you can't make your
|
20
|
+
tests async (perhaps you're on Python 3.7 where ``IsolatedAsyncioTestCase``
|
21
|
+
isn't available).
|
22
|
+
|
23
|
+
For example::
|
24
|
+
|
25
|
+
class TestBand(TableTest):
|
26
|
+
tables = [Band]
|
27
|
+
|
28
|
+
def test_band(self):
|
29
|
+
...
|
30
|
+
|
31
|
+
""" # noqa: E501
|
32
|
+
|
33
|
+
tables: t.List[t.Type[Table]]
|
34
|
+
|
35
|
+
def setUp(self) -> None:
|
36
|
+
create_db_tables_sync(*self.tables)
|
37
|
+
|
38
|
+
def tearDown(self) -> None:
|
39
|
+
drop_db_tables_sync(*self.tables)
|
40
|
+
|
41
|
+
|
42
|
+
class AsyncTableTest(IsolatedAsyncioTestCase):
|
43
|
+
"""
|
44
|
+
Used for tests where we need to create Piccolo tables - they will
|
45
|
+
automatically be created and dropped.
|
46
|
+
|
47
|
+
For example::
|
48
|
+
|
49
|
+
class TestBand(AsyncTableTest):
|
50
|
+
tables = [Band]
|
51
|
+
|
52
|
+
async def test_band(self):
|
53
|
+
...
|
54
|
+
|
55
|
+
"""
|
56
|
+
|
57
|
+
tables: t.List[t.Type[Table]]
|
58
|
+
|
59
|
+
async def asyncSetUp(self) -> None:
|
60
|
+
await create_db_tables(*self.tables)
|
61
|
+
|
62
|
+
async def asyncTearDown(self) -> None:
|
63
|
+
await drop_db_tables(*self.tables)
|
64
|
+
|
65
|
+
|
66
|
+
class AsyncTransactionTest(IsolatedAsyncioTestCase):
|
67
|
+
"""
|
68
|
+
Wraps each test in a transaction, which is automatically rolled back when
|
69
|
+
the test finishes.
|
70
|
+
|
71
|
+
.. warning::
|
72
|
+
Python 3.11 and above only.
|
73
|
+
|
74
|
+
If your test suite just contains ``AsyncTransactionTest`` tests, then you
|
75
|
+
can setup your database tables once before your test suite runs. Any
|
76
|
+
changes made to your tables by the tests will be rolled back automatically.
|
77
|
+
|
78
|
+
Here's an example::
|
79
|
+
|
80
|
+
from piccolo.testing.test_case import AsyncTransactionTest
|
81
|
+
|
82
|
+
|
83
|
+
class TestBandEndpoint(AsyncTransactionTest):
|
84
|
+
|
85
|
+
async def test_band_response(self):
|
86
|
+
\"\"\"
|
87
|
+
Make sure the endpoint returns a 200.
|
88
|
+
\"\"\"
|
89
|
+
band = Band({Band.name: "Pythonistas"})
|
90
|
+
await band.save()
|
91
|
+
|
92
|
+
# Using an API testing client, like httpx:
|
93
|
+
response = await client.get(f"/bands/{band.id}/")
|
94
|
+
self.assertEqual(response.status_code, 200)
|
95
|
+
|
96
|
+
We add a ``Band`` to the database, but any subsequent tests won't see it,
|
97
|
+
as the changes are rolled back automatically.
|
98
|
+
|
99
|
+
"""
|
100
|
+
|
101
|
+
# We use `engine_finder` to find the current `Engine`, but you can
|
102
|
+
# explicity set it here if you prefer:
|
103
|
+
#
|
104
|
+
# class MyTest(AsyncTransactionTest):
|
105
|
+
# db = DB
|
106
|
+
#
|
107
|
+
# ...
|
108
|
+
#
|
109
|
+
db: t.Optional[Engine] = None
|
110
|
+
|
111
|
+
async def asyncSetUp(self) -> None:
|
112
|
+
db = self.db or engine_finder()
|
113
|
+
assert db is not None
|
114
|
+
self.transaction = db.transaction()
|
115
|
+
# This is only available in Python 3.11 and above:
|
116
|
+
await self.enterAsyncContext(cm=self.transaction) # type: ignore
|
117
|
+
|
118
|
+
async def asyncTearDown(self):
|
119
|
+
await super().asyncTearDown()
|
120
|
+
await self.transaction.rollback()
|
@@ -185,6 +185,7 @@ piccolo/query/methods/update.py
|
|
185
185
|
piccolo/testing/__init__.py
|
186
186
|
piccolo/testing/model_builder.py
|
187
187
|
piccolo/testing/random_builder.py
|
188
|
+
piccolo/testing/test_case.py
|
188
189
|
piccolo/utils/__init__.py
|
189
190
|
piccolo/utils/dictionary.py
|
190
191
|
piccolo/utils/encoding.py
|
@@ -365,6 +366,7 @@ tests/table/instance/test_to_dict.py
|
|
365
366
|
tests/testing/__init__.py
|
366
367
|
tests/testing/test_model_builder.py
|
367
368
|
tests/testing/test_random_builder.py
|
369
|
+
tests/testing/test_test_case.py
|
368
370
|
tests/utils/__init__.py
|
369
371
|
tests/utils/test_dictionary.py
|
370
372
|
tests/utils/test_encoding.py
|
@@ -2,7 +2,7 @@ import asyncio
|
|
2
2
|
import random
|
3
3
|
import typing as t
|
4
4
|
from io import StringIO
|
5
|
-
from unittest import TestCase
|
5
|
+
from unittest import IsolatedAsyncioTestCase, TestCase
|
6
6
|
from unittest.mock import MagicMock, patch
|
7
7
|
|
8
8
|
from piccolo.apps.migrations.auto.migration_manager import MigrationManager
|
@@ -11,6 +11,7 @@ from piccolo.columns import Text, Varchar
|
|
11
11
|
from piccolo.columns.base import OnDelete, OnUpdate
|
12
12
|
from piccolo.columns.column_types import ForeignKey
|
13
13
|
from piccolo.conf.apps import AppConfig
|
14
|
+
from piccolo.engine import engine_finder
|
14
15
|
from piccolo.table import Table, sort_table_classes
|
15
16
|
from piccolo.utils.lazy_loader import LazyLoader
|
16
17
|
from tests.base import AsyncMock, DBTestCase, engine_is, engines_only
|
@@ -1052,3 +1053,37 @@ class TestMigrationManager(DBTestCase):
|
|
1052
1053
|
output,
|
1053
1054
|
' - 1 [preview forwards]... CREATE SCHEMA IF NOT EXISTS "schema_1"\nALTER TABLE "manager" SET SCHEMA "schema_1"\n', # noqa: E501
|
1054
1055
|
)
|
1056
|
+
|
1057
|
+
|
1058
|
+
class TestWrapInTransaction(IsolatedAsyncioTestCase):
|
1059
|
+
|
1060
|
+
async def test_enabled(self):
|
1061
|
+
"""
|
1062
|
+
Make sure we can wrap the migration in a transaction if we want to.
|
1063
|
+
"""
|
1064
|
+
|
1065
|
+
async def run():
|
1066
|
+
db = engine_finder()
|
1067
|
+
assert db
|
1068
|
+
assert db.transaction_exists() is True
|
1069
|
+
|
1070
|
+
manager = MigrationManager(wrap_in_transaction=True)
|
1071
|
+
manager.add_raw(run)
|
1072
|
+
|
1073
|
+
await manager.run()
|
1074
|
+
|
1075
|
+
async def test_disabled(self):
|
1076
|
+
"""
|
1077
|
+
Make sure we can stop the migration being wrapped in a transaction if
|
1078
|
+
we want to.
|
1079
|
+
"""
|
1080
|
+
|
1081
|
+
async def run():
|
1082
|
+
db = engine_finder()
|
1083
|
+
assert db
|
1084
|
+
assert db.transaction_exists() is False
|
1085
|
+
|
1086
|
+
manager = MigrationManager(wrap_in_transaction=False)
|
1087
|
+
manager.add_raw(run)
|
1088
|
+
|
1089
|
+
await manager.run()
|
@@ -14,7 +14,8 @@ from piccolo.columns.column_types import (
|
|
14
14
|
)
|
15
15
|
from piccolo.querystring import QueryString
|
16
16
|
from piccolo.table import Table
|
17
|
-
from
|
17
|
+
from piccolo.testing.test_case import TableTest
|
18
|
+
from tests.base import engines_only, engines_skip, sqlite_only
|
18
19
|
|
19
20
|
|
20
21
|
class MyTable(Table):
|
@@ -2,7 +2,8 @@ import enum
|
|
2
2
|
|
3
3
|
from piccolo.columns.column_types import Array, Varchar
|
4
4
|
from piccolo.table import Table
|
5
|
-
from
|
5
|
+
from piccolo.testing.test_case import TableTest
|
6
|
+
from tests.base import engines_only
|
6
7
|
from tests.example_apps.music.tables import Shirt
|
7
8
|
|
8
9
|
|
@@ -3,7 +3,7 @@ import datetime
|
|
3
3
|
from piccolo.columns.column_types import Interval
|
4
4
|
from piccolo.columns.defaults.interval import IntervalCustom
|
5
5
|
from piccolo.table import Table
|
6
|
-
from
|
6
|
+
from piccolo.testing.test_case import TableTest
|
7
7
|
|
8
8
|
|
9
9
|
class MyTable(Table):
|
@@ -1,6 +1,7 @@
|
|
1
1
|
from piccolo.columns.column_types import JSONB, ForeignKey, Varchar
|
2
2
|
from piccolo.table import Table
|
3
|
-
from
|
3
|
+
from piccolo.testing.test_case import TableTest
|
4
|
+
from tests.base import engines_only, engines_skip
|
4
5
|
|
5
6
|
|
6
7
|
class RecordingStudio(Table):
|
@@ -8,7 +8,7 @@ from unittest import TestCase
|
|
8
8
|
from piccolo.columns import ForeignKey, Varchar
|
9
9
|
from piccolo.columns.reference import LazyTableReference
|
10
10
|
from piccolo.table import Table
|
11
|
-
from
|
11
|
+
from piccolo.testing.test_case import TableTest
|
12
12
|
|
13
13
|
|
14
14
|
class Band(Table):
|
@@ -4,7 +4,8 @@ from functools import partial
|
|
4
4
|
from piccolo.columns.column_types import Time
|
5
5
|
from piccolo.columns.defaults.time import TimeNow
|
6
6
|
from piccolo.table import Table
|
7
|
-
from
|
7
|
+
from piccolo.testing.test_case import TableTest
|
8
|
+
from tests.base import engines_skip
|
8
9
|
|
9
10
|
|
10
11
|
class MyTable(Table):
|
@@ -3,7 +3,7 @@ import datetime
|
|
3
3
|
from piccolo.columns.column_types import Timestamp
|
4
4
|
from piccolo.columns.defaults.timestamp import TimestampNow
|
5
5
|
from piccolo.table import Table
|
6
|
-
from
|
6
|
+
from piccolo.testing.test_case import TableTest
|
7
7
|
|
8
8
|
|
9
9
|
class MyTable(Table):
|
@@ -12,7 +12,8 @@ from piccolo.query.functions.datetime import (
|
|
12
12
|
Year,
|
13
13
|
)
|
14
14
|
from piccolo.table import Table
|
15
|
-
from
|
15
|
+
from piccolo.testing.test_case import TableTest
|
16
|
+
from tests.base import engines_only, sqlite_only
|
16
17
|
|
17
18
|
|
18
19
|
class Concert(Table):
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import sys
|
2
|
+
|
3
|
+
import pytest
|
4
|
+
|
5
|
+
from piccolo.engine import engine_finder
|
6
|
+
from piccolo.testing.test_case import (
|
7
|
+
AsyncTableTest,
|
8
|
+
AsyncTransactionTest,
|
9
|
+
TableTest,
|
10
|
+
)
|
11
|
+
from tests.example_apps.music.tables import Band, Manager
|
12
|
+
|
13
|
+
|
14
|
+
class TestTableTest(TableTest):
|
15
|
+
"""
|
16
|
+
Make sure the tables are created automatically.
|
17
|
+
"""
|
18
|
+
|
19
|
+
tables = [Band, Manager]
|
20
|
+
|
21
|
+
async def test_tables_created(self):
|
22
|
+
self.assertTrue(Band.table_exists().run_sync())
|
23
|
+
self.assertTrue(Manager.table_exists().run_sync())
|
24
|
+
|
25
|
+
|
26
|
+
class TestAsyncTableTest(AsyncTableTest):
|
27
|
+
"""
|
28
|
+
Make sure the tables are created automatically in async tests.
|
29
|
+
"""
|
30
|
+
|
31
|
+
tables = [Band, Manager]
|
32
|
+
|
33
|
+
async def test_tables_created(self):
|
34
|
+
self.assertTrue(await Band.table_exists())
|
35
|
+
self.assertTrue(await Manager.table_exists())
|
36
|
+
|
37
|
+
|
38
|
+
@pytest.mark.skipif(sys.version_info <= (3, 11), reason="Python 3.11 required")
|
39
|
+
class TestAsyncTransaction(AsyncTransactionTest):
|
40
|
+
"""
|
41
|
+
Make sure that the test exists within a transaction.
|
42
|
+
"""
|
43
|
+
|
44
|
+
async def test_transaction_exists(self):
|
45
|
+
db = engine_finder()
|
46
|
+
assert db is not None
|
47
|
+
self.assertTrue(db.transaction_exists())
|
48
|
+
|
49
|
+
|
50
|
+
@pytest.mark.skipif(sys.version_info <= (3, 11), reason="Python 3.11 required")
|
51
|
+
class TestAsyncTransactionRolledBack(AsyncTransactionTest):
|
52
|
+
"""
|
53
|
+
Make sure that the changes get rolled back automatically.
|
54
|
+
"""
|
55
|
+
|
56
|
+
async def asyncTearDown(self):
|
57
|
+
await super().asyncTearDown()
|
58
|
+
|
59
|
+
assert Manager.table_exists().run_sync() is False
|
60
|
+
|
61
|
+
async def test_insert_data(self):
|
62
|
+
await Manager.create_table()
|
63
|
+
|
64
|
+
manager = Manager({Manager.name: "Guido"})
|
65
|
+
await manager.save()
|
@@ -1 +0,0 @@
|
|
1
|
-
__VERSION__ = "1.15.0"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja
RENAMED
File without changes
|
{piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/_esmerald_app.py.jinja
RENAMED
File without changes
|
{piccolo-1.15.0 → piccolo-1.17.0}/piccolo/apps/asgi/commands/templates/app/_fastapi_app.py.jinja
RENAMED
File without changes
|