'Ensure specific password expiry is set.'

def test_set_explicit_password_expiry(self):

    self.assertFalse(hasattr(self.user, 'password_expiry'))
    expiration_period = 60
    out = StringIO()
    call_command('user_password_expiry', 'patrick', '--expire={}'.format(expiration_period), stdout=out)
    user = self.UserModel.objects.get(username='patrick')
    user_expiry = user.password_expiry
    self.assertEqual(user_expiry.expiry, expiration_period)
    self.assertIn('User    "{}"    password    expiration    set    to    {}    seconds'.format(self.user.username, expiration_period), out.getvalue())
