diff --git a/edx_name_affirmation/tests/test_signals.py b/edx_name_affirmation/tests/test_signals.py index a5c5d5f..e742023 100644 --- a/edx_name_affirmation/tests/test_signals.py +++ b/edx_name_affirmation/tests/test_signals.py @@ -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, @@ -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, @@ -55,3 +53,14 @@ def test_retirement_signal_no_verified_names(self): no_verified_user = User(username='no_verified', email='no_verified@test.com') _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)