Skip to content

Commit

Permalink
test: resolving test coverage failure for encryption setters
Browse files Browse the repository at this point in the history
  • Loading branch information
MueezKhan246 committed Apr 30, 2024
1 parent fd06e4c commit 36ddb42
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,17 @@ 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],
}
response = self.client.put(url, payload)
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)

Expand Down Expand Up @@ -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, '')

0 comments on commit 36ddb42

Please sign in to comment.