Skip to content

Commit

Permalink
test: add case for multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
varshamenon4 committed Sep 12, 2024
1 parent 050684c commit cdfcb96
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions edx_name_affirmation/tests/test_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def setUp(self):
self.name = 'Jonathan Smith'
self.profile_name = 'Jon Smith'
self.idv_attempt_id = 1111111
self.proctoring_attempt_id = 2222222
self.verified_name_obj = VerifiedName.objects.create(
user=self.user,
verified_name=self.name,
Expand All @@ -38,7 +37,6 @@ def setUp(self):
self.other_name = 'Jonathan Other'
self.other_profile_name = 'Jon Other'
self.other_idv_attempt_id = 1111112
self.other_proctoring_attempt_id = 2222223
self.verified_name_obj = VerifiedName.objects.create(
user=self.other_user,
verified_name=self.other_name,
Expand All @@ -55,3 +53,14 @@ def test_retirement_signal_no_verified_names(self):
no_verified_user = User(username='no_verified', email='[email protected]')
_listen_for_lms_retire_verified_names(sender=self.__class__, user=no_verified_user)
self.assertEqual(len(VerifiedName.objects.all()), 2)

def test_retirement_signal_all_verified_names_for_user(self):
# create a second verified name for user to check that both names are deleted
VerifiedName.objects.create(
user=self.user,
verified_name='J Smith',
profile_name=self.profile_name,
verification_attempt_id=1111112
)
_listen_for_lms_retire_verified_names(sender=self.__class__, user=self.user)
self.assertEqual(len(VerifiedName.objects.filter(user=self.user)), 0)

0 comments on commit cdfcb96

Please sign in to comment.