'Tests that if we provide password characters less then PASSWORD_MIN_LENGTH,
or more than PASSWORD_MAX_LENGTH, password reset will fail with error message.'

@override_settings(PASSWORD_MIN_LENGTH=2)
@override_settings(PASSWORD_MAX_LENGTH=10)
@ddt.data({'password': '1', 'error_message': 'Password:    Invalid    Length    (must    be    2    characters    or    more)'}, {'password': '01234567891', 'error_message': 'Password:    Invalid    Length    (must    be    10    characters    or    fewer)'})
def test_password_reset_with_invalid_length(self, password_dict):

    url = reverse('password_reset_confirm', kwargs={'uidb36': self.uidb36, 'token': self.token})
    request_params = {'new_password1': password_dict['password'], 'new_password2': password_dict['password']}
    confirm_request = self.request_factory.post(url, data=request_params)
    response = password_reset_confirm_wrapper(confirm_request, self.uidb36, self.token)
    self.assertEqual(response.context_data['err_msg'], password_dict['error_message'])
