From a9d29f8ae6b558c608b9bdf9f7260873a6ee3859 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 25 May 2020 17:15:35 +0100 Subject: added to README and enhanced view test --- README.rst | 8 +++++--- ctrack/users/tests/test_views.py | 7 ++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 2abf739..5f85b0b 100644 --- a/README.rst +++ b/README.rst @@ -20,7 +20,9 @@ What is ctrack? Recognising this need, **ctrack** is a proof-of-concept web application developed in-house by the Cyber Compliance Team at the UK Department for Transport that aims to demonstrate the improvements in workflow possible by storing data associated with OES and its associated CAF data in a relational database. It focuses on the absolute basics of managing any business data: *Create*, *Read*, *Update*, *Delete* (CRUD) functionality and demonstrates how collection and analysis of ongoing assessment data - using the CAF as the foundation (the framework, not the spreadsheet) - can be exponentially improved using the simplest of form-based web application. -Sensitivity of data --------------------- +Technical Notes +--------------- -This application is only a proof-of-concept and does not address the issue of deployment to a secure platform which will be required in future when handling real data. +- A User can also be associated with a "stakeholder" object, which represents + a Person in the system who is also a User. This means there is an option for designated + third-parties can also have rights to log into the system diff --git a/ctrack/users/tests/test_views.py b/ctrack/users/tests/test_views.py index 7c1d33c..7c2c8be 100644 --- a/ctrack/users/tests/test_views.py +++ b/ctrack/users/tests/test_views.py @@ -56,7 +56,7 @@ def test_profile_view_contains_organisation_information(person): user = get_user_model().objects.create_user( username="testy", email="testy@test.com", password="test1020" ) - org = person.organisation.name + org_name = person.organisation.name stakeholder = Stakeholder.objects.create(person=person) user.stakeholder = stakeholder user.save() @@ -70,6 +70,11 @@ def test_profile_view_contains_organisation_information(person): assert response.context_data["user"].username == "testy" assert response.context_data["user"].is_stakeholder() is True assert response.context_data["user"].stakeholder.person.first_name == "Chinaplate" + assert ( + response.context_data["user"].stakeholder.person.get_organisation_name() + == org_name + ) + assert response.context_data["user"].get_organisation_name() == org_name # assert response.context_data["user"].stakeholder.person.first_name == "Chinaplate" -- cgit v1.2.3