generated from john/python-template
This commit is contained in:
@@ -41,7 +41,28 @@ class TestPeoplePageRendering:
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Ada Lovelace" in response.text
|
||||
assert "Ada" in response.text
|
||||
assert "FamilySearch ID" in response.text
|
||||
assert "# Documents" in response.text
|
||||
assert "Display Name" not in response.text
|
||||
assert "Maiden Name" not in response.text
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_people_page_shows_document_counts(self, app_client):
|
||||
_, client = app_client
|
||||
|
||||
async with session_scope() as session:
|
||||
role = (await session.exec(select(PersonRole).where(PersonRole.semantic_key == "author"))).one()
|
||||
person = Person(full_name="Counted Person")
|
||||
document = Document(name="Linked For Count")
|
||||
session.add_all([person, document])
|
||||
await session.flush()
|
||||
session.add(DocumentPerson(document_id=document.id, person_id=person.id, role_id=role.id))
|
||||
await session.commit()
|
||||
|
||||
response = client.get("/ui/people")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert '"document_count":1' in response.text
|
||||
|
||||
def test_person_create_page_renders_fields(self, app_client):
|
||||
_, client = app_client
|
||||
|
||||
Reference in New Issue
Block a user