'Ensure authenticated user is redirected to change password
when retrieving account settings page if password is expired.'

def test_get_expired(self):

    self.history.timestamp = (datetime.datetime.now(tz=pytz.UTC) - datetime.timedelta(days=1, seconds=self.expiry.expiry))
    self.history.save()
    self.client.login(username=self.username, password=self.password)
    url_name = 'account_settings'
    response = self.client.get(reverse(url_name))
    redirect_url = '{}?next={}'.format(reverse('account_password'), url_name)
    self.assertRedirects(response, redirect_url)
