generated from john/python-template
V5.1 Modify Person table: split full name into first & last, added tags support
Quality Gate / gate (push) Failing after 11s
Quality Gate / gate (push) Failing after 11s
This commit is contained in:
@@ -53,7 +53,7 @@ def _persist_document(session) -> Document:
|
||||
|
||||
|
||||
def _persist_person(session, **overrides: Any) -> Person:
|
||||
defaults: dict[str, Any] = {"full_name": "Ada Lovelace"}
|
||||
defaults: dict[str, Any] = {"given_names": "Ada", "last_name": "Lovelace"}
|
||||
defaults.update(overrides)
|
||||
person = Person(**defaults)
|
||||
session.add(person)
|
||||
@@ -195,10 +195,10 @@ 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.add(Person(given_names="First", last_name="Person", family_search_id="G8T4-MDQ"))
|
||||
session.commit()
|
||||
|
||||
session.add(Person(full_name="Second Person", family_search_id="G8T4-MDQ"))
|
||||
session.add(Person(given_names="Second", last_name="Person", family_search_id="G8T4-MDQ"))
|
||||
with pytest.raises(IntegrityError):
|
||||
session.commit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user