diff --git a/tests/test_database.py b/tests/test_database.py index d37a2c5..c4cfa1e 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -192,3 +192,17 @@ def test_database_upgrade(test_folder: Path, temp_folder: Path): assert db.original_files.select(limit=1).fetchone() assert db.master_files.select(limit=1).fetchone() + + for master_file in db.master_files: + if master_file.processed == 0: + assert db.access_files[{"original_uuid": str(master_file.uuid)}] is None + assert db.statutory_files[{"original_uuid": str(master_file.uuid)}] is None + elif master_file.processed == 1: + assert db.access_files[{"original_uuid": str(master_file.uuid)}] is not None + assert db.statutory_files[{"original_uuid": str(master_file.uuid)}] is None + elif master_file.processed == 2: + assert db.access_files[{"original_uuid": str(master_file.uuid)}] is None + assert db.statutory_files[{"original_uuid": str(master_file.uuid)}] is not None + elif master_file.processed == 3: + assert db.access_files[{"original_uuid": str(master_file.uuid)}] is not None + assert db.statutory_files[{"original_uuid": str(master_file.uuid)}] is not None