diff --git a/apps/cli/utilities/test_data/insert_one_bogus_project_into_archive.py b/apps/cli/utilities/test_data/insert_one_bogus_project_into_archive.py new file mode 100644 index 0000000000000000000000000000000000000000..8a76d559a146f3b54bd335feeeb31c4b76e12d93 --- /dev/null +++ b/apps/cli/utilities/test_data/insert_one_bogus_project_into_archive.py @@ -0,0 +1,25 @@ +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}') +