'Assert that a user should not be able to password reset too frequently'

@patch.dict('django.conf.settings.ADVANCED_SECURITY_CONFIG', {'MIN_TIME_IN_DAYS_BETWEEN_ALLOWED_RESETS': 1})
def test_too_frequent_password_resets(self):

    student = self._user_factory_with_history()
    grandfathered_student = self._user_factory_with_history(set_initial_history=False)
    self.assertTrue(PasswordHistory.is_password_reset_too_soon(student))
    self.assertFalse(PasswordHistory.is_password_reset_too_soon(grandfathered_student))
    staff_reset_time = (timezone.now() + timedelta(days=100))
    with freeze_time(staff_reset_time):
        self.assertFalse(PasswordHistory.is_password_reset_too_soon(student))
