

def test_management_command(self):
    '\n        The ``cleanupregistration`` management command properly\n        deletes expired accounts.\n        \n        '
    new_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), **new_user.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()
    management.call_command('cleanupregistration')
    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_management_command/VarMisuse@31/74 `self`->`new_user`