From f73d2e494420df99a34e1fda246d01a7ace5cb3e Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sat, 30 May 2020 17:23:43 +0100 Subject: cleaned up old User tests --- ctrack/organisations/tests/factories.py | 10 ---------- ctrack/organisations/tests/test_factories.py | 14 +++++--------- 2 files changed, 5 insertions(+), 19 deletions(-) (limited to 'ctrack/organisations/tests') diff --git a/ctrack/organisations/tests/factories.py b/ctrack/organisations/tests/factories.py index ba2655e..a0b700d 100644 --- a/ctrack/organisations/tests/factories.py +++ b/ctrack/organisations/tests/factories.py @@ -32,16 +32,6 @@ def _random_submode(): return sms[random.randint(0, len(sms) - 1)] -class UserFactory(DjangoModelFactory): - # Better to create this using example in ctrack.users.tests.factories. - # Handles password generation correctly. - class Meta: - model = User - - username = Faker("lexify", text="???????", letters="abcdsgTGQA") - password = Faker("lexify", text="????????", letters="AdOIqkcvBnMP") - - class OrganisationFactory(DjangoModelFactory): class Meta: model = Organisation diff --git a/ctrack/organisations/tests/test_factories.py b/ctrack/organisations/tests/test_factories.py index 9c0d575..227d7db 100644 --- a/ctrack/organisations/tests/test_factories.py +++ b/ctrack/organisations/tests/test_factories.py @@ -1,12 +1,8 @@ -from ctrack.organisations.tests.factories import OrganisationFactory -from ctrack.organisations.tests.factories import PersonFactory -from ctrack.organisations.tests.factories import RoleFactory -from ctrack.organisations.tests.factories import UserFactory - - -def test_user_factory(): - u = UserFactory.build() - assert u.username +from ctrack.organisations.tests.factories import ( + OrganisationFactory, + PersonFactory, + RoleFactory, +) def test_organisation_factory(): -- cgit v1.2.3 From 10579be5293908b57336ecd769b8e17a610e008a Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sat, 30 May 2020 17:24:41 +0100 Subject: added a fixture file for an incident report if needed --- ctrack/organisations/tests/incident_report.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 ctrack/organisations/tests/incident_report.json (limited to 'ctrack/organisations/tests') diff --git a/ctrack/organisations/tests/incident_report.json b/ctrack/organisations/tests/incident_report.json new file mode 100644 index 0000000..2b03d48 --- /dev/null +++ b/ctrack/organisations/tests/incident_report.json @@ -0,0 +1,25 @@ +[ +{ + "model": "organisations.incidentreport", + "pk": 1, + "fields": { + "organisation": 15, + "reporting_person": 15, + "person_involved": "Robin Cousins", + "role": "Team Ice Skater", + "phone_number": "08929 390 30943", + "email": "a@example.com", + "internal_incident_number": "092T", + "date_time_incident_detected": "2020-05-28T00:00:00Z", + "date_time_incident_reported": "2020-05-30T15:21:52.171Z", + "incident_type": "Cyber", + "incident_status": "Detected", + "incident_stage": "Ongoing", + "summary": "We were woken to 10am by the crying of children. A school bus had tipped over on the dual carriageway outside the HQ and several of the occupants had spilled out on to the verge and we somewhat distraight. It appeared that the automatic road stinger had activated outside our main gatehouse (we use this to stop people leaving who have not paid for the photocopying that day).", + "mitigations": "We have been able to remove the wires that attach the ejector module to the power unit, but we don't know how to do anything else. The maintenance engineer is in Tenerife and not answering his phone.", + "others_informed": "The local convent school St Mirium Collete of the Roasted Saint. They sent their societial liaison officer to take pictures of the scene for their Tinder account.", + "next_steps": "Once we get hold of someone how knows how to fix the system, we intend to make sure there is an adequate response, but at the moment, this simply isn't possible. Sorry!", + "dft_handle_status": "QUEUED" + } +} +] -- cgit v1.2.3