diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-24 16:05:57 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-24 16:05:57 +0100 |
commit | 2fa3b7134661deb201b1a9a9a907f0a8051640be (patch) | |
tree | 5236b0fde2b8dba57f49dba098df0edec9980741 /ctrack/organisations/tests | |
parent | 457cd45a13a4cd73626d70367be1179a070700f3 (diff) |
Contact history for person page added but doesn't filter private events out yet
Diffstat (limited to 'ctrack/organisations/tests')
-rw-r--r-- | ctrack/organisations/tests/test_views.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ctrack/organisations/tests/test_views.py b/ctrack/organisations/tests/test_views.py index c939894..c1eb3ef 100644 --- a/ctrack/organisations/tests/test_views.py +++ b/ctrack/organisations/tests/test_views.py @@ -16,6 +16,27 @@ from ..views import OrganisationListView pytestmark = pytest.mark.django_db +def test_person_history_view(user, client, org_with_people): + person = org_with_people.person_set.first() + e1 = SingleDateTimeEventFactory.create( + type_descriptor="MEETING", short_description="First Meeting" + ) + e2 = SingleDateTimeEventFactory.create( + type_descriptor="MEETING", short_description="Second Meeting" + ) + e1.participants.add(person) + e1.save() + e2.participants.add(person) + e2.save() + client.force_login(user) + response = client.get( + reverse("organisations:person_contact_history", kwargs={"person_id": person.pk}) + ) + assert response.status_code == 200 + html = response.content.decode("utf-8") + assert "First Meeting" in html + + def test_organisation_by_inspector_view(inspector1, inspector2, client, submode): org = OrganisationFactory(submode=submode, lead_inspector=inspector1, deputy_lead_inspector=inspector2) client.force_login(inspector1) |