

def test_expired_user_deletion(self):
    '\n        ``RegistrationProfile.objects.delete_expired_users()`` only\n        deletes inactive users whose activation window has expired.\n        \n        '
    new_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), **self.user_info)
    expired_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), username='bob', password='secret', email='bob@example.com')
    expired_user.date_joined -= datetime.timedelta(days=(settings.ACCOUNT_ACTIVATION_DAYS + 1))
    expired_user.save()
    RegistrationProfile.objects.delete_expired_users()
    self.assertEqual(RegistrationProfile.objects.count(), 1)
    self.assertRaises(User.DoesNotExist, User.objects.get, username='bob')

dataset/ETHPy150Open codesters/codesters/registration/tests/models.py RegistrationModelTests.test_expired_user_deletion/original