Skip to content

Commit

Permalink
Cleaned test_user test file.
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricbonhomme committed Dec 12, 2019
1 parent 29c7b9a commit 6a236b8
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions tests/test_user.py
@@ -1,20 +1,13 @@
import os
import tempfile

import pytest
from flask import Flask
from werkzeug.security import generate_password_hash

from mosp.models import db_init
# from mosp.bootstrap import application
from mosp.bootstrap import db as _db

from mosp.models import User





@pytest.fixture(scope='session')
def app(request):
"""Session-wide test `Flask` application."""
Expand All @@ -39,7 +32,6 @@ def teardown():
@pytest.fixture(scope='session')
def db(app, request):
"""Session-wide test database."""

def teardown():
_db.drop_all()

Expand Down Expand Up @@ -78,30 +70,3 @@ def test_user(session):
session.commit()

assert user.is_admin == False



#
# @pytest.fixture
# def client():
# db_fd, application.config['DATABASE'] = tempfile.mkstemp()
# application.config['TESTING'] = True
#
# with application.test_client() as client:
# with application.app_context():
# db_init(db)
# yield client
#
# os.close(db_fd)
# os.unlink(application.config['DATABASE'])


# @pytest.fixture
# def new_user(client):
# user = User(login='john1', pwdhash=generate_password_hash('password'))
# client.session.add(user)
# client.session.commit()
# yield user
#
# def test_rights(new_user):
# assert new_user.is_admin == False

0 comments on commit 6a236b8

Please sign in to comment.