Commit 9b1103aa authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fix repo db initialisation for missing schema.

parent 7d8b7723
......@@ -280,7 +280,7 @@ def reset_repository_db():
with repository_db_connection(with_trans=False) as conn:
with conn.cursor() as cur:
cur.execute(
"DROP SCHEMA public CASCADE;"
"DROP SCHEMA IF EXISTS public CASCADE;"
"CREATE SCHEMA public;"
"GRANT ALL ON SCHEMA public TO postgres;"
"GRANT ALL ON SCHEMA public TO public;")
......
......@@ -4,7 +4,7 @@ from sqlalchemy.orm import Session
from mongoengine import connect
from mongoengine.connection import disconnect
from nomad import config, infrastructure, coe_repo
from nomad import config, infrastructure
@pytest.fixture(scope="session")
......@@ -119,16 +119,19 @@ def repository_db(monkeysession):
@pytest.fixture(scope='session')
def test_user(repository_db):
from nomad import coe_repo
return coe_repo.ensure_test_user(email='sheldon.cooper@nomad-fairdi.tests.de')
@pytest.fixture(scope='session')
def other_test_user(repository_db):
from nomad import coe_repo
return coe_repo.ensure_test_user(email='leonard.hofstadter@nomad-fairdi.tests.de')
@pytest.fixture(scope='session')
def admin_user(repository_db):
from nomad import coe_repo
return coe_repo.admin_user()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment