From 86c49f7dcea98265d8efa9a1071262cdec7a0bc8 Mon Sep 17 00:00:00 2001 From: MueezKhan246 <93375917+MueezKhan246@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:50:31 +0000 Subject: [PATCH] test: removed redundant test case --- .../oauth_dispatch/dot_overrides/validators.py | 1 - .../oauth_dispatch/tests/test_dot_overrides.py | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/openedx/core/djangoapps/oauth_dispatch/dot_overrides/validators.py b/openedx/core/djangoapps/oauth_dispatch/dot_overrides/validators.py index 72475b3d53..f8cf053814 100644 --- a/openedx/core/djangoapps/oauth_dispatch/dot_overrides/validators.py +++ b/openedx/core/djangoapps/oauth_dispatch/dot_overrides/validators.py @@ -5,7 +5,6 @@ Classes that override default django-oauth-toolkit behavior from datetime import datetime, timedelta -from django.conf import settings from django.contrib.auth import authenticate, get_user_model from django.db.models.signals import pre_save from django.dispatch import receiver diff --git a/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_overrides.py b/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_overrides.py index 7c12965cf6..52a79615c2 100644 --- a/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_overrides.py +++ b/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_overrides.py @@ -81,7 +81,6 @@ class CustomValidationTestCase(TestCase): request = self.request_factory.get('/') assert self.validator.validate_user('darkhelmet', self.TEST_PASSWORD, client=None, request=request) - @mock.patch.dict(settings.FEATURES, ENABLE_USER_ID_SCOPE=True) def test_get_default_scopes_with_user_id(self): """ Test that get_default_scopes returns the default scopes plus the user_id scope if it's available. @@ -93,20 +92,6 @@ class CustomValidationTestCase(TestCase): self.assertEqual(overriden_default_scopes, self.default_scopes + ['user_id']) - @mock.patch.dict(settings.FEATURES, ENABLE_USER_ID_SCOPE=False) - def test_get_default_scopes_without_user_id(self): - """ - Test that if `ENABLE_USER_ID_SCOPE` flag is turned off, the get_default_scopes returns - the default scopes without `user_id` even if it's allowed. - """ - application_access = ApplicationAccessFactory(scopes=['user_id']) - - request = mock.Mock(grant_type='client_credentials', client=application_access.application, scopes=None) - overriden_default_scopes = self.validator.get_default_scopes(request=request, client_id='client_id') - - self.assertEqual(overriden_default_scopes, self.default_scopes) - - @mock.patch.dict(settings.FEATURES, ENABLE_USER_ID_SCOPE=True) def test_get_default_scopes(self): """ Test that get_default_scopes returns the default scopes if user_id scope is not available.