Fix UI tests

This commit is contained in:
rubenwardy 2021-07-24 02:32:28 +01:00
parent 347f8e5a22
commit 24e3b1505b
2 changed files with 39 additions and 2 deletions

@ -9,8 +9,9 @@ def test_login_logout(client):
rv = client.get("/") rv = client.get("/")
assert not is_logged_in(rv) assert not is_logged_in(rv)
assert b"Sign out" not in rv.data
rv = login(client, "rubenwardy", "tuckfrump") rv = login(client, "rubenwardy", "tuckfrump")
assert b"Logged in successfully." in rv.data assert b"Sign out" in rv.data
assert is_logged_in(rv) assert is_logged_in(rv)
rv = client.get("/") rv = client.get("/")
@ -81,6 +82,7 @@ def test_register_flow(client):
rv = client.get(url_for('users.verify_email', token=email.token), follow_redirects=True) rv = client.get(url_for('users.verify_email', token=email.token), follow_redirects=True)
assert b"You may now log in" in rv.data assert b"You may now log in" in rv.data
assert b"Sign out" not in rv.data
rv = login(client, username, "password") rv = login(client, username, "password")
assert b"Logged in successfully." in rv.data assert b"Sign out" in rv.data
assert is_logged_in(rv) assert is_logged_in(rv)

@ -0,0 +1,35 @@
"""empty message
Revision ID: 51be0401bb85
Revises: d4262fb15b37
Create Date: 2021-07-24 00:25:04.706191
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '51be0401bb85'
down_revision = 'd4262fb15b37'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('package_alias',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('package_id', sa.Integer(), nullable=False),
sa.Column('author', sa.String(length=50), nullable=False),
sa.Column('name', sa.String(length=100), nullable=False),
sa.ForeignKeyConstraint(['package_id'], ['package.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('package_alias')
# ### end Alembic commands ###