Skip to content
Snippets Groups Projects
Commit d32a5945 authored by jgoldste's avatar jgoldste
Browse files

SSA-6324: demo: failure to insert fake project for testing

parent 7cc1c078
No related branches found
No related tags found
No related merge requests found
import pytest
from sqlalchemy import table
from shared.schema.src.schema import create_session, Project
session = create_session('SDM', profile='local')
to_insert = Project(project_code='FAKE_TEST_PROJECT',
title='Move along move along nothing to see here',
starttime=56688.8103640046,
endtime=-56810.4840497685,
proprietary_duration=120)
try:
table(Project).insert(to_insert)
session.commit()
session.flush()
except Exception as exc:
pytest.fail(f'insert failed: {exc}')
try:
retrieved = session.query(Project).filter(Project==to_insert).first()
if retrieved is None:
pytest.fail(f'{to_insert} not found')
except Exception as exc:
pytest.fail(f'retrieval failed: {exc}')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment