Skip to content

Commit 87475aa

Browse files
committed
squash
1 parent 557704e commit 87475aa

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

openedx/core/djangoapps/user_authn/views/tests/test_register.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3071,7 +3071,7 @@ def test_pwned_password_and_emit_track_event(self, emit):
30713071

30723072

30733073
@ddt.ddt
3074-
class SAMLProviderFieldOverridesTest(ThirdPartyAuthTestMixin, test_utils.ApiTestCase):
3074+
class SAMLProviderFieldOverridesTest(ThirdPartyAuthTestMixin, UserAPITestCase):
30753075
"""
30763076
Tests for SAML provider-specific registration field overrides.
30773077
@@ -3082,6 +3082,11 @@ class SAMLProviderFieldOverridesTest(ThirdPartyAuthTestMixin, test_utils.ApiTest
30823082

30833083
MARKETING_EMAILS_OPT_IN_ATTR = 'MARKETING_EMAILS_OPT_IN'
30843084

3085+
@classmethod
3086+
def setUpClass(cls):
3087+
"""Set up class method for the Test class."""
3088+
super().setUpClass()
3089+
30853090
def setUp(self, *args, **kwargs):
30863091
super().setUp(*args, **kwargs)
30873092
self.url = reverse('user_api_registration')
@@ -3130,7 +3135,7 @@ def test_provider_without_overrides(self):
31303135

31313136
extra_fields = {'marketing_emails_opt_in': 'optional'}
31323137

3133-
with simulate_running_pipeline('common.djangoapps.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
3138+
with simulate_running_pipeline('openedx.core.djangoapps.user_authn.views.registration_form.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
31343139
field = self._get_form_field('marketing_emails_opt_in', extra_fields)
31353140

31363141
# Field should use platform default (optional = not required)
@@ -3154,7 +3159,7 @@ def test_marketing_field_hidden(self):
31543159

31553160
extra_fields = {'marketing_emails_opt_in': 'optional'}
31563161

3157-
with simulate_running_pipeline('common.djangoapps.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
3162+
with simulate_running_pipeline('openedx.core.djangoapps.user_authn.views.registration_form.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
31583163
field = self._get_form_field('marketing_emails_opt_in', extra_fields)
31593164

31603165
# Field should be hidden
@@ -3179,7 +3184,7 @@ def test_marketing_field_required(self):
31793184

31803185
extra_fields = {'marketing_emails_opt_in': 'optional'}
31813186

3182-
with simulate_running_pipeline('common.djangoapps.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
3187+
with simulate_running_pipeline('openedx.core.djangoapps.user_authn.views.registration_form.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
31833188
field = self._get_form_field('marketing_emails_opt_in', extra_fields)
31843189

31853190
# Field should be required
@@ -3205,7 +3210,7 @@ def test_marketing_field_optional(self):
32053210
# Platform default is required
32063211
extra_fields = {'marketing_emails_opt_in': 'required'}
32073212

3208-
with simulate_running_pipeline('common.djangoapps.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
3213+
with simulate_running_pipeline('openedx.core.djangoapps.user_authn.views.registration_form.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
32093214
field = self._get_form_field('marketing_emails_opt_in', extra_fields)
32103215

32113216
# Field should be optional (not required)
@@ -3229,7 +3234,7 @@ def test_research_field_hidden(self):
32293234

32303235
extra_fields = {'research': 'optional'}
32313236

3232-
with simulate_running_pipeline('common.djangoapps.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
3237+
with simulate_running_pipeline('openedx.core.djangoapps.user_authn.views.registration_form.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
32333238
field = self._get_form_field('research', extra_fields)
32343239

32353240
# Field should be hidden
@@ -3258,7 +3263,7 @@ def test_multiple_fields_overridden(self):
32583263
'research': 'optional'
32593264
}
32603265

3261-
with simulate_running_pipeline('common.djangoapps.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
3266+
with simulate_running_pipeline('openedx.core.djangoapps.user_authn.views.registration_form.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
32623267
marketing_field = self._get_form_field('marketing_emails_opt_in', extra_fields)
32633268
research_field = self._get_form_field('research', extra_fields)
32643269

@@ -3287,7 +3292,7 @@ def test_invalid_override_value_ignored(self):
32873292

32883293
extra_fields = {'marketing_emails_opt_in': 'optional'}
32893294

3290-
with simulate_running_pipeline('common.djangoapps.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
3295+
with simulate_running_pipeline('openedx.core.djangoapps.user_authn.views.registration_form.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
32913296
field = self._get_form_field('marketing_emails_opt_in', extra_fields)
32923297

32933298
# Field should use platform default since override value is invalid
@@ -3314,7 +3319,7 @@ def test_field_not_in_platform_settings(self):
33143319
# Only enable marketing_emails_opt_in, not research
33153320
extra_fields = {'marketing_emails_opt_in': 'optional'}
33163321

3317-
with simulate_running_pipeline('common.djangoapps.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
3322+
with simulate_running_pipeline('openedx.core.djangoapps.user_authn.views.registration_form.third_party_auth.pipeline', 'tpa-saml', response={'idp_name': 'test-saml'}):
33183323
# This should not raise an error
33193324
response = self.client.get(self.url)
33203325
self.assertEqual(response.status_code, 200)

0 commit comments

Comments
 (0)