Skip to content

Commit

Permalink
added codes to check super admin register.py
Browse files Browse the repository at this point in the history
updated import
  • Loading branch information
taka-rl committed Oct 16, 2024
1 parent 83c0972 commit 31bf87a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from flask_app import create_app
from flask_app.models import db, User
from werkzeug.security import generate_password_hash
from parameters import SUPER_ADMIN_EMAIL, SUPER_ADMIN_PASSWORD, SUPER_ADMIN_NAME
from tests.parameters import SUPER_ADMIN_EMAIL, SUPER_ADMIN_PASSWORD, SUPER_ADMIN_NAME


@pytest.fixture
Expand Down
6 changes: 4 additions & 2 deletions tests/test_admin.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
from flask_app.models import User, db
from werkzeug.security import generate_password_hash
from parameters import TEST_NAME, TEST_EMAIL, TEST_PASSWORD, SUPER_ADMIN_EMAIL, SUPER_ADMIN_PASSWORD
from parameters import TEST_NAME, TEST_EMAIL, TEST_PASSWORD, SUPER_ADMIN_EMAIL, SUPER_ADMIN_NAME


def test_check_super_admin_exist(client):
# Verify the super admin exists in the database
# Verify the super admin stored in conftest.py exists in the database
super_admin_user = User.query.filter_by(email=SUPER_ADMIN_EMAIL).first()
assert super_admin_user is not None
assert super_admin_user.email == SUPER_ADMIN_EMAIL
assert super_admin_user.name == SUPER_ADMIN_NAME
assert super_admin_user.role == 'Super Admin'


Expand Down

0 comments on commit 31bf87a

Please sign in to comment.