From 36ddb42a8517bb4ba4496e087c9b8f1a40aaaf9e Mon Sep 17 00:00:00 2001 From: MueezKhan246 Date: Tue, 30 Apr 2024 18:58:20 +0500 Subject: [PATCH] test: resolving test coverage failure for encryption setters --- .../test_api/test_blackboard/test_views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_integrated_channels/test_api/test_blackboard/test_views.py b/tests/test_integrated_channels/test_api/test_blackboard/test_views.py index 112dd85dc1..2f0bf79218 100644 --- a/tests/test_integrated_channels/test_api/test_blackboard/test_views.py +++ b/tests/test_integrated_channels/test_api/test_blackboard/test_views.py @@ -129,6 +129,8 @@ def test_update(self, mock_current_request): payload = { 'client_secret': 1000, 'client_id': 1001, + 'encrypted_client_secret': 1000, + 'encrypted_client_id': 1001, 'blackboard_base_url': 'http://testing2', 'enterprise_customer': FAKE_UUIDS[0], } @@ -136,6 +138,8 @@ def test_update(self, mock_current_request): self.enterprise_customer_conf.refresh_from_db() self.assertEqual(self.enterprise_customer_conf.client_secret, '1000') self.assertEqual(self.enterprise_customer_conf.client_id, '1001') + self.assertEqual(self.enterprise_customer_conf.decrypted_client_secret, '1000') + self.assertEqual(self.enterprise_customer_conf.decrypted_client_id, '1001') self.assertEqual(self.enterprise_customer_conf.blackboard_base_url, 'http://testing2') self.assertEqual(response.status_code, 200) @@ -215,7 +219,7 @@ def test_global_config_get(self, mock_current_request): self.assertTrue(hasattr(self.global_config, 'decrypted_app_secret')) self.assertIsNotNone(self.global_config.encrypted_app_secret) - self.global_config.decrypted_app_secret = '' + self.global_config.encrypted_app_secret = '' self.global_config.save() self.assertTrue(hasattr(self.global_config, 'decrypted_app_secret')) self.assertEqual(self.global_config.encrypted_app_secret, '')