'Ensure existing password expiry is reset.'

def test_reset_existing_password_expiry(self):

    previous_expiry = 123
    existing_expiry = PasswordExpiry.objects.create(user=self.user, expiry=previous_expiry)
    out = StringIO()
    call_command('user_password_expiry', 'patrick', stdout=out)
    user = self.UserModel.objects.get(username='patrick')
    user_expiry = user.password_expiry
    self.assertEqual(user_expiry, existing_expiry)
    default_expiration = settings.ACCOUNT_PASSWORD_EXPIRY
    self.assertEqual(user_expiry.expiry, default_expiration)
    self.assertNotEqual(user_expiry.expiry, previous_expiry)
