generated from john/python-template
V4.1 Mostly UI adjustments by GC
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
"""Tests for the V2 SQLModel persistence layer and relationships."""
|
||||
|
||||
from datetime import UTC
|
||||
from datetime import datetime
|
||||
from uuid import UUID
|
||||
|
||||
import pytest
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
|
||||
from transcription.db.models import Document
|
||||
from transcription.db.models import DocumentType
|
||||
from transcription.db.models import DocumentPerson
|
||||
from transcription.db.models import DocumentPersonRole
|
||||
from transcription.db.models import DocumentType
|
||||
from transcription.db.models import Job
|
||||
from transcription.db.models import JobSource
|
||||
from transcription.db.models import JobSourceStatus
|
||||
@@ -181,6 +179,14 @@ class TestSourceModel:
|
||||
|
||||
|
||||
class TestPersonAndDocumentPersonModel:
|
||||
def test_family_search_id_is_unique_when_present(self, session):
|
||||
session.add(Person(full_name="First Person", family_search_id="G8T4-MDQ"))
|
||||
session.commit()
|
||||
|
||||
session.add(Person(full_name="Second Person", family_search_id="G8T4-MDQ"))
|
||||
with pytest.raises(IntegrityError):
|
||||
session.commit()
|
||||
|
||||
def test_document_person_role_is_unique_per_document_person(self, session):
|
||||
document = _persist_document(session)
|
||||
person = _persist_person(session)
|
||||
|
||||
Reference in New Issue
Block a user