From 0e99db8b8fa39b3f38b9a4d23a8c2fa2c23dc0c3 Mon Sep 17 00:00:00 2001 From: Muhammad Sameer Amin <35958006+sameeramin@users.noreply.github.com> Date: Wed, 28 Aug 2024 12:47:53 +0500 Subject: [PATCH] fix: fixed the api test for canvas view --- .../test_api/test_canvas/test_views.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/test_integrated_channels/test_api/test_canvas/test_views.py b/tests/test_integrated_channels/test_api/test_canvas/test_views.py index 926295eb95..a5dbefc2d3 100644 --- a/tests/test_integrated_channels/test_api/test_canvas/test_views.py +++ b/tests/test_integrated_channels/test_api/test_canvas/test_views.py @@ -33,8 +33,8 @@ def setUp(self): self.enterprise_customer_conf = factories.CanvasEnterpriseCustomerConfigurationFactory( enterprise_customer=self.enterprise_customer, - client_id='ayy', - client_secret='lmao', + encrypted_client_id='ayy', + encrypted_client_secret='lmao', ) @mock.patch('enterprise.rules.crum.get_current_request') @@ -120,6 +120,8 @@ def test_update(self, mock_current_request): payload = { 'canvas_account_id': 1000, 'enterprise_customer': ENTERPRISE_ID, + 'encrypted_client_id': '', + 'encrypted_client_secret': '', } response = self.client.put(url, payload) self.enterprise_customer_conf.refresh_from_db() @@ -169,8 +171,8 @@ def test_is_valid_field(self, mock_current_request): assert missing.get('missing') == ['refresh_token'] assert incorrect.get('incorrect') == ['canvas_base_url', 'display_name'] - self.enterprise_customer_conf.client_id = '' - self.enterprise_customer_conf.client_secret = '' + self.enterprise_customer_conf.decrypted_client_id = '' + self.enterprise_customer_conf.decrypted_client_secret = '' self.enterprise_customer_conf.canvas_base_url = '' self.enterprise_customer_conf.canvas_account_id = None self.enterprise_customer_conf.save() @@ -184,8 +186,8 @@ def test_is_valid_field(self, mock_current_request): # Add a refresh token and assert that is_valid now passes self.enterprise_customer_conf.refresh_token = 'ayylmao' self.enterprise_customer_conf.canvas_base_url = 'http://lovely.com' - self.enterprise_customer_conf.client_id = '1' - self.enterprise_customer_conf.client_secret = '1' + self.enterprise_customer_conf.decrypted_client_id = '1' + self.enterprise_customer_conf.decrypted_client_secret = '1' self.enterprise_customer_conf.canvas_account_id = 1 self.enterprise_customer_conf.display_name = 'nice<3' self.enterprise_customer_conf.save()