New Unittest for user login

This commit is contained in:
kelepirci 2016-07-21 00:40:34 +03:00
parent 9e92b60468
commit ce702e6178
5 changed files with 1 additions and 129 deletions

View File

@ -34,6 +34,7 @@ class TestingConfig(Config):
SQLALCHEMY_DATABASE_URI = os.environ.get('TEST_DATABASE_URL') or \
('mysql://root:Polo1043@localhost/dashTest')
SQLALCHEMY_TRACK_MODIFICATIONS = True
WTF_CSRF_ENABLED = False
class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \

View File

@ -1,30 +0,0 @@
"""empty message
Revision ID: 24ea14f8cb4e
Revises: 8491b2bf3af9
Create Date: 2016-07-09 23:21:24.446391
"""
# revision identifiers, used by Alembic.
revision = '24ea14f8cb4e'
down_revision = '8491b2bf3af9'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('email', sa.String(length=128), nullable=True))
op.add_column('users', sa.Column('password_hash', sa.String(length=128), nullable=True))
op.create_index(op.f('ix_users_email'), 'users', ['email'], unique=True)
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_users_email'), table_name='users')
op.drop_column('users', 'password_hash')
op.drop_column('users', 'email')
### end Alembic commands ###

View File

@ -1,26 +0,0 @@
"""empty message
Revision ID: 28f38d9e7724
Revises: 24ea14f8cb4e
Create Date: 2016-07-10 18:31:53.096426
"""
# revision identifiers, used by Alembic.
revision = '28f38d9e7724'
down_revision = '24ea14f8cb4e'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('created_at', sa.DateTime(), nullable=True))
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'created_at')
### end Alembic commands ###

View File

@ -1,41 +0,0 @@
"""empty message
Revision ID: 2db95cb9bcc9
Revises: None
Create Date: 2016-07-09 21:55:58.385082
"""
# revision identifiers, used by Alembic.
revision = '2db95cb9bcc9'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_table('roles',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=64), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
)
op.create_table('users',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('username', sa.String(length=64), nullable=True),
sa.Column('role_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['role_id'], ['roles.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_users_username'), 'users', ['username'], unique=True)
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_users_username'), table_name='users')
op.drop_table('users')
op.drop_table('roles')
### end Alembic commands ###

View File

@ -1,32 +0,0 @@
"""empty message
Revision ID: 8491b2bf3af9
Revises: 2db95cb9bcc9
Create Date: 2016-07-09 22:49:27.082441
"""
# revision identifiers, used by Alembic.
revision = '8491b2bf3af9'
down_revision = '2db95cb9bcc9'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('avatar', sa.String(length=256), nullable=True))
op.add_column('users', sa.Column('full_name', sa.String(length=256), nullable=True))
op.create_index(op.f('ix_users_avatar'), 'users', ['avatar'], unique=False)
op.create_index(op.f('ix_users_full_name'), 'users', ['full_name'], unique=False)
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_users_full_name'), table_name='users')
op.drop_index(op.f('ix_users_avatar'), table_name='users')
op.drop_column('users', 'full_name')
op.drop_column('users', 'avatar')
### end Alembic commands ###