Skip to content

Commit

Permalink
[chores] Updated tests for fallback fields
Browse files Browse the repository at this point in the history
  • Loading branch information
pandafy committed Aug 7, 2024
1 parent 81ef599 commit d1c5b99
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
8 changes: 0 additions & 8 deletions openwisp_radius/tests/test_api/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ def test_is_registration_enabled(self):

with self.subTest('Test registration enabled set to True'):
org.radius_settings.registration_enabled = True
org.radius_settings.save(update_fields=['registration_enabled'])
org.radius_settings.refresh_from_db(fields=['registration_enabled'])
self.assertEqual(
get_organization_radius_settings(org, 'registration_enabled'), True
)

with self.subTest('Test registration enabled set to False'):
org.radius_settings.registration_enabled = False
org.radius_settings.save(update_fields=['registration_enabled'])
org.radius_settings.refresh_from_db(fields=['registration_enabled'])
self.assertEqual(
get_organization_radius_settings(org, 'registration_enabled'), False
)
Expand Down Expand Up @@ -56,16 +52,12 @@ def test_is_sms_verification_enabled(self):

with self.subTest('Test sms verification enabled set to True'):
org.radius_settings.sms_verification = True
org.radius_settings.save(update_fields=['sms_verification'])
org.radius_settings.refresh_from_db(fields=['sms_verification'])
self.assertEqual(
get_organization_radius_settings(org, 'sms_verification'), True
)

with self.subTest('Test sms verification enabled set to False'):
org.radius_settings.sms_verification = False
org.radius_settings.save(update_fields=['sms_verification'])
org.radius_settings.refresh_from_db(fields=['sms_verification'])
self.assertEqual(
get_organization_radius_settings(org, 'sms_verification'), False
)
Expand Down
4 changes: 0 additions & 4 deletions openwisp_radius/tests/test_saml/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ def test_is_saml_authentication_enabled(self):

with self.subTest('Test saml_registration_enabled set to True'):
org.radius_settings.saml_registration_enabled = True
org.radius_settings.save(update_fields=['saml_registration_enabled'])
org.radius_settings.refresh_from_db(fields=['saml_registration_enabled'])
self.assertEqual(
get_organization_radius_settings(org, 'saml_registration_enabled'), True
)

with self.subTest('Test saml_registration_enabled set to False'):
org.radius_settings.saml_registration_enabled = False
org.radius_settings.save(update_fields=['saml_registration_enabled'])
org.radius_settings.refresh_from_db(fields=['saml_registration_enabled'])
self.assertEqual(
get_organization_radius_settings(org, 'saml_registration_enabled'),
False,
Expand Down
4 changes: 0 additions & 4 deletions openwisp_radius/tests/test_social.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,13 @@ def test_is_social_authentication_enabled(self):

with self.subTest('Test social_registration_enabled set to True'):
org.radius_settings.social_registration_enabled = True
org.radius_settings.save(update_fields=['social_registration_enabled'])
org.radius_settings.refresh_from_db(fields=['social_registration_enabled'])
self.assertEqual(
get_organization_radius_settings(org, 'social_registration_enabled'),
True,
)

with self.subTest('Test social_registration_enabled set to False'):
org.radius_settings.social_registration_enabled = False
org.radius_settings.save(update_fields=['social_registration_enabled'])
org.radius_settings.refresh_from_db(fields=['social_registration_enabled'])
self.assertEqual(
get_organization_radius_settings(org, 'social_registration_enabled'),
False,
Expand Down

0 comments on commit d1c5b99

Please sign in to comment.