From aea7b23aabc9d5b8a78bd538d0c34016af3b5c0e Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Fri, 10 Jul 2020 14:52:08 -0400 Subject: [PATCH 1/4] Removes unnecessary test workflow spec --- crc/static/bpmn/group_test/group_test.bpmn | 82 --------------------- crc/static/bpmn/group_test/lookup.xlsx | Bin 9125 -> 0 bytes example_data.py | 6 -- 3 files changed, 88 deletions(-) delete mode 100644 crc/static/bpmn/group_test/group_test.bpmn delete mode 100644 crc/static/bpmn/group_test/lookup.xlsx diff --git a/crc/static/bpmn/group_test/group_test.bpmn b/crc/static/bpmn/group_test/group_test.bpmn deleted file mode 100644 index aed16ffd..00000000 --- a/crc/static/bpmn/group_test/group_test.bpmn +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Flow_1gnws9u - - - - Flow_1xria19 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Flow_1gnws9u - Flow_0zud2rb - - - - lookup_dropdown: {{ lookup_dropdown }} -lookup_checkbox: {{ lookup_checkbox }} -lookup_radio: {{ lookup_radio }} - - - Flow_0zud2rb - Flow_1xria19 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/crc/static/bpmn/group_test/lookup.xlsx b/crc/static/bpmn/group_test/lookup.xlsx deleted file mode 100644 index 2861a655b8cd7b7e04573dba52b47678cb75f1cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9125 zcmeHN1y>x|)@>YuLy+JeoW|V=1h)W<1oy@p*WiIhf;%Az1Sdd(Tkr+~p^@Mc0>NE^ z^L1w4doz=n?-#sxd#$>wSJggstM1AFMb0RsY4pwK!Qg<9$(9^ za;ePM%3uoahV>J%YfF9XN$D%IGR}8!xXX{ZB9MDU;wW50^m#sj?{L_@*2TF#?0H{{ z4h}RF_EFE2QkbW=e}}n)>_M`Jk>P&9eM%YL2WDpRwmE=I_l9mA0fn!!Disv=B&1T$ zzU9sK>k}^ZHQ|&Qm59RTI+r!{7YRiMOUDVm!HFj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@im^&jMjU2`Mg_hs2LWBF{nHI>{5TFj zZh$Lzz71%pC6wpiO?|+#U4E0Xz-wz>+1|5Jfi&`NLi06o&1*YyHTfeT~|M zR6!)kgq_d7OqY|)>zyRBNlV|R1BDe@ldARd=7QI2+TcUlFTx>T&4Hn-eWEKPwepvX zPIQOT&odw^Nfs-4ZuKZj0+115DN)VK?f~j$%-c-L;*FfscPCUnUunpfru|-Sop0WAm^vGM=G~>d|PLNr;%INMtbyp;0E`&e( z=MN(OJ!}8&|KalpE!Dpo_-pC*-@u=J20|KtD&+nO{A)Su&%jp1SpWax)~|Mct#SNe zX&({%{!;Py75rS`hdBHQ)8CfnQ_vKMZV;{%7ES zi`aj)@@ts#hZPQr-=E;upygK!e|4sR-~oVsN&w(*uJu>=Usu9E! Date: Fri, 10 Jul 2020 16:17:49 -0400 Subject: [PATCH 2/4] Fixes some syntax issues --- .../ids_full_submission.bpmn | 122 +++++++++--------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/crc/static/bpmn/ids_full_submission/ids_full_submission.bpmn b/crc/static/bpmn/ids_full_submission/ids_full_submission.bpmn index 719b3257..498c1215 100644 --- a/crc/static/bpmn/ids_full_submission/ids_full_submission.bpmn +++ b/crc/static/bpmn/ids_full_submission/ids_full_submission.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_1dexemq @@ -100,7 +100,7 @@ Protocol Owner: **(need to insert value here)** - + @@ -123,7 +123,7 @@ Protocol Owner: **(need to insert value here)** - + @@ -159,13 +159,13 @@ Protocol Owner: **(need to insert value here)** - + - + @@ -223,122 +223,122 @@ Protocol Owner: **(need to insert value here)** - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + From ccb2addeb58ad508074a74da85e21da6634c5925 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Fri, 10 Jul 2020 16:27:09 -0400 Subject: [PATCH 3/4] Fixes another one --- crc/static/bpmn/ids_full_submission/ids_full_submission.bpmn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crc/static/bpmn/ids_full_submission/ids_full_submission.bpmn b/crc/static/bpmn/ids_full_submission/ids_full_submission.bpmn index 498c1215..72fece25 100644 --- a/crc/static/bpmn/ids_full_submission/ids_full_submission.bpmn +++ b/crc/static/bpmn/ids_full_submission/ids_full_submission.bpmn @@ -206,7 +206,7 @@ Protocol Owner: **(need to insert value here)** - + SequenceFlow_0lixqzs From 3c8e1e5c375d4ffd695e2d20bee95f80ba9eca00 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Mon, 13 Jul 2020 11:02:29 -0400 Subject: [PATCH 4/4] Tests for presence of data property in enum options --- tests/test_tasks_api.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/test_tasks_api.py b/tests/test_tasks_api.py index 7a7f3c76..ebe99d93 100644 --- a/tests/test_tasks_api.py +++ b/tests/test_tasks_api.py @@ -83,6 +83,17 @@ class TestTasksApi(BaseTest): workflow = WorkflowApiSchema().load(json_data) return workflow + def assert_options_populated(self, results, lookup_data_keys): + option_keys = ['value', 'label', 'data'] + self.assertIsInstance(results, list) + for result in results: + for option_key in option_keys: + self.assertTrue(option_key in result, 'should have value, label, and data properties populated') + self.assertIsNotNone(result[option_key], '%s should not be None' % option_key) + + self.assertIsInstance(result['data'], dict) + for lookup_data_key in lookup_data_keys: + self.assertTrue(lookup_data_key in result['data'], 'should have all lookup data columns populated') def test_get_current_user_tasks(self): self.load_example_data() @@ -342,6 +353,7 @@ class TestTasksApi(BaseTest): self.assert_success(rv) results = json.loads(rv.get_data(as_text=True)) self.assertEqual(5, len(results)) + self.assert_options_populated(results, ['CUSTOMER_NUMBER', 'CUSTOMER_NAME', 'CUSTOMER_CLASS_MEANING']) def test_lookup_endpoint_for_task_field_using_lookup_entry_id(self): self.load_example_data() @@ -357,13 +369,15 @@ class TestTasksApi(BaseTest): self.assert_success(rv) results = json.loads(rv.get_data(as_text=True)) self.assertEqual(5, len(results)) + self.assert_options_populated(results, ['CUSTOMER_NUMBER', 'CUSTOMER_NAME', 'CUSTOMER_CLASS_MEANING']) + rv = self.app.get('/v1.0/workflow/%i/lookup/%s?value=%s' % (workflow.id, field_id, results[0]['value']), # All records with a word that starts with 'c' headers=self.logged_in_headers(), content_type="application/json") results = json.loads(rv.get_data(as_text=True)) self.assertEqual(1, len(results)) - self.assertIsInstance(results[0]['data'], dict) + self.assert_options_populated(results, ['CUSTOMER_NUMBER', 'CUSTOMER_NAME', 'CUSTOMER_CLASS_MEANING']) self.assertNotIn('id', results[0], "Don't include the internal id, that can be very confusing, and should not be used.") def test_lookup_endpoint_also_works_for_enum(self): @@ -371,7 +385,7 @@ class TestTasksApi(BaseTest): # In the event of an auto-complete it's a type-ahead search field, for an enum the # the key/values from the spreadsheet are added directly to the form and it shows up as # a dropdown. This tests the case of wanting to get additional data when a user selects - # something from a drodown. + # something from a dropdown. self.load_example_data() workflow = self.create_workflow('enum_options_from_file') # get the first form in the two form workflow. @@ -386,6 +400,7 @@ class TestTasksApi(BaseTest): self.assert_success(rv) results = json.loads(rv.get_data(as_text=True)) self.assertEqual(1, len(results)) + self.assert_options_populated(results, ['CUSTOMER_NUMBER', 'CUSTOMER_NAME', 'CUSTOMER_CLASS_MEANING']) self.assertIsInstance(results[0]['data'], dict) def test_lookup_endpoint_for_task_ldap_field_lookup(self): @@ -402,6 +417,9 @@ class TestTasksApi(BaseTest): content_type="application/json") self.assert_success(rv) results = json.loads(rv.get_data(as_text=True)) + self.assert_options_populated(results, ['telephone_number', 'affiliation', 'uid', 'title', + 'given_name', 'department', 'date_cached', 'sponsor_type', + 'display_name', 'email_address']) self.assertEqual(1, len(results)) def test_sub_process(self):