Module Expr Str Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad NameLoad Str decorator_list Call AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Return Call NameLoad NameLoad Str decorator_list Call AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call NameLoad Str NameLoad Expr Call NameLoad Str NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Num TryFinally body Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr Str Assert Call AttributeLoad NameLoad attr Str finalbody Expr Call NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call NameLoad Str NameLoad keyword Str Expr Call NameLoad Str NameLoad keyword Num keyword Str Expr Call AttributeLoad NameLoad attr Num TryFinally body Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr Str Assert Call AttributeLoad NameLoad attr Str finalbody Expr Call NameLoad Str NameLoad keyword Str decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call NameLoad Str NameLoad keyword BinOpMult Num Num Expr Call NameLoad Str NameLoad keyword BinOpMult Num Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call NameLoad Str NameLoad keyword Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call NameLoad Str NameLoad keyword Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assert Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str With Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Str Str NameLoad body Expr Call NameLoad Str NameLoad Expr Call NameLoad Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Str Str Assert Call NameLoad GeneratorExp CompareIn Str NameLoad comprehension NameStore NameLoad Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call NameLoad Str NameLoad keyword Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call NameLoad Str NameLoad Expr Call NameLoad Str NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call NameLoad Str NameLoad keyword Str Expr Call NameLoad Str NameLoad keyword Str Expr Call NameLoad Str NameLoad keyword Num keyword Str Expr Call AttributeLoad NameLoad attr Num TryFinally body Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr Str Assert Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad Call AttributeLoad NameLoad attr Str attr Assert Call AttributeLoad NameLoad attr Str finalbody Expr Call NameLoad Str NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call NameLoad Str NameLoad Expr Call NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call NameLoad Str NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call NameLoad Str NameLoad keyword Str keyword Num Expr Call NameLoad Str NameLoad keyword Str Expr Call NameLoad Str NameLoad keyword Str keyword Num decorator_list Assign NameStore Str
N/A N/A Exercise websauna_app scaffold and Websauna command line scripts.

Rerunning these tests can be greatly sped up by creating a local Python package cache (wheelhouse)::

    bash websauna/tests/create_wheelhouse.bash

 N/A time N/A os N/A pytest flaky flaky scaffold execute_venv_command scaffold replace_file scaffold app_scaffold scaffold create_psq_db dev_db N/A N/A request N/A N/A N/A Create PostgreSQL database myapcdp_dev and return its connection information. N/A N/A create_psq_db request myapp_dev N/A N/A N/A pytest fixture test_db N/A N/A request N/A N/A N/A N/A create_psq_db request myapp_test N/A N/A N/A pytest fixture test_pserve N/A N/A app_scaffold dev_db browser N/A N/A N/A Create an application and see if ws-pserve starts.  N/A N/A execute_venv_command cd myapp && ws-sync-db conf/development.ini app_scaffold N/A N/A execute_venv_command cd myapp && ws-pserve conf/development.ini --pid-file=test_pserve.pid app_scaffold wait_and_see 3.0 N/A N/A N/A time sleep 4.0 N/A N/A N/A b browser N/A N/A N/A b visit http://localhost:6543 N/A N/A N/A b is_element_present_by_css #demo-text N/A N/A N/A execute_venv_command cd myapp && ws-pserve conf/development.ini --stop-daemon --pid-file=test_pserve.pid app_scaffold N/A test_pyramid_debugtoolbar N/A N/A app_scaffold dev_db browser N/A N/A N/A Pyramid debug toolbar should be effective with the default development ws-pserve. N/A N/A execute_venv_command ws-sync-db conf/development.ini app_scaffold cd_folder myapp N/A N/A execute_venv_command ws-pserve conf/development.ini --pid-file=test_pserve.pid app_scaffold wait_and_see 3.0 cd_folder myapp N/A N/A N/A time sleep 3.0 N/A N/A N/A b browser N/A N/A N/A b visit http://localhost:6543/error-trigger N/A N/A N/A b is_element_present_by_css .errormsg N/A N/A N/A execute_venv_command ws-pserve conf/development.ini --stop-daemon --pid-file=test_pserve.pid app_scaffold cd_folder myapp N/A flaky test_pytest N/A N/A app_scaffold test_db N/A N/A N/A Create an application and see if py.test tests pass.  N/A N/A execute_venv_command cd myapp && pip install '.[test]' app_scaffold timeout N/A 2 60 N/A N/A execute_venv_command py.test --ini myapp/conf/test.ini myapp/myapp/tests app_scaffold timeout N/A 1 60 N/A flaky test_sdist N/A N/A app_scaffold N/A N/A N/A Create an application and see if sdist egg can be created.  N/A N/A execute_venv_command cd myapp && python setup.py sdist app_scaffold N/A test_app_syncdb N/A N/A app_scaffold dev_db N/A N/A N/A Create an application and see if database is correctly created. N/A N/A execute_venv_command cd myapp && ws-sync-db conf/development.ini app_scaffold N/A test_shell N/A N/A app_scaffold dev_db N/A N/A N/A Create an application and see if shell is started. N/A N/A execute_venv_command cd myapp && ws-shell conf/development.ini app_scaffold wait_and_see 2.0 N/A test_db_shell N/A N/A app_scaffold dev_db N/A N/A N/A Create an application and see if shell is started. N/A N/A execute_venv_command cd myapp && ws-db-shell conf/development.ini app_scaffold wait_and_see 2.0 N/A test_gitignore N/A N/A app_scaffold dev_db N/A N/A N/A We construct a proper .gitignore file for the project. N/A N/A N/A N/A os path exists N/A N/A N/A os path join app_scaffold myapp .gitignore N/A test_migration N/A N/A app_scaffold dev_db N/A N/A N/A Create an application, add a model and see if migrations are run. N/A N/A replace_file N/A N/A N/A os path join app_scaffold myapp myapp models.py MODELS_PY N/A N/A N/A execute_venv_command cd myapp && ws-alembic -x packages=all -c conf/development.ini revision --autogenerate -m 'Added MyModel' app_scaffold N/A N/A execute_venv_command cd myapp && ws-alembic -x packages=all -c conf/development.ini upgrade head app_scaffold N/A files N/A N/A os listdir N/A N/A N/A os path join app_scaffold myapp alembic versions N/A N/A any N/A N/A added_mymodel.py f N/A f files N/A N/A Got files {} format files N/A test_app_sanity_check_fail N/A N/A app_scaffold dev_db N/A N/A N/A Create an application and see we don't start if migrations are not run. N/A N/A execute_venv_command cd myapp && ws-pserve conf/development.ini app_scaffold assert_exit 1 N/A test_dump_db N/A N/A app_scaffold dev_db N/A N/A N/A Test database dump. N/A N/A execute_venv_command cd myapp && ws-sync-db conf/development.ini app_scaffold N/A N/A execute_venv_command cd myapp && ws-dump-db conf/development.ini app_scaffold N/A flaky test_create_user N/A N/A app_scaffold dev_db browser N/A N/A N/A Test creating user from command line and logging in as this user. N/A N/A execute_venv_command ws-sync-db conf/development.ini app_scaffold cd_folder myapp N/A N/A execute_venv_command ws-create-user conf/development.ini mikko@example.com secret app_scaffold cd_folder myapp N/A N/A execute_venv_command ws-pserve conf/development.ini --pid-file=test_pserve.pid app_scaffold wait_and_see 3.0 cd_folder myapp N/A N/A N/A time sleep 2 N/A N/A N/A b browser N/A N/A N/A b visit http://localhost:6543/login N/A N/A N/A b is_element_present_by_css #login-form N/A N/A N/A b fill username mikko@example.com N/A N/A N/A b fill password secret N/A N/A N/A N/A N/A b find_by_name login_email click N/A N/A N/A b is_element_present_by_css #nav-admin N/A N/A N/A execute_venv_command cd myapp && ws-pserve conf/development.ini --stop-daemon --pid-file=test_pserve.pid app_scaffold N/A flaky test_tweens N/A N/A app_scaffold dev_db N/A N/A N/A Test tweens command. N/A N/A execute_venv_command cd myapp && ws-sync-db conf/development.ini app_scaffold N/A N/A execute_venv_command cd myapp && ws-tweens conf/development.ini app_scaffold N/A test_create_table N/A N/A app_scaffold dev_db N/A N/A N/A Test ws-create-table command. N/A N/A execute_venv_command ws-create-table conf/development.ini app_scaffold cd_folder myapp N/A test_sanity_check N/A N/A app_scaffold dev_db N/A N/A N/A Test sanity check command. N/A N/A execute_venv_command ws-sanity-check conf/development.ini app_scaffold cd_folder myapp assert_exit 10 N/A N/A execute_venv_command ws-sync-db conf/development.ini app_scaffold cd_folder myapp N/A N/A execute_venv_command ws-sanity-check conf/development.ini app_scaffold cd_folder myapp assert_exit 0 N/A N/A MODELS_PY 
from websauna.system.model.meta import Base
from sqlalchemy import Column
from sqlalchemy import Integer


class MyModel(Base):
    __tablename__ = "mymodel"
    id = Column(Integer, autoincrement=True, primary_key=True)

