'Ensure changing password results in new PasswordHistory,
even when no PasswordHistory exists.'

def test_password_expiration_reset(self):

    history_count = self.user.password_history.count()
    self.client.login(username=self.username, password=self.password)
    new_password = 'lynyrdskynyrd'
    post_data = {'password_current': self.password, 'password_new': new_password, 'password_new_confirm': new_password}
    with override_settings(ACCOUNT_PASSWORD_USE_HISTORY=True):
        self.client.post(reverse('account_password'), post_data)
        self.assertEquals(self.user.password_history.count(), (history_count + 1))
