Пример #1
0
def step_impl(context):
    password_generator = RandomCompliantPasswordGenerator()
    context.credentials[
        'password'] = password_generator.get_compliant_password()
    assertPasswordIsCompliant(context.credentials['password'])
    test_client = context.test.client
    context.response = set_new_password(test_client, **context.credentials)
Пример #2
0
def step_impl(context):
    # in this case, the choice of the password is irrelevant; it must only comply to the password policy
    context.current_user = deepcopy(context.consumer)
    context.current_encrypted_password = get_current_encrypted_password(
        context.current_user['email'])
    assertPasswordIsCompliant(context.current_user['password'])
    test_client = context.test.client
    context.response = signup(test_client, **context.current_user)
Пример #3
0
def step_impl(context):
    password_generator = RandomCompliantPasswordGenerator()
    context.credentials[
        'password'] = password_generator.get_compliant_password()
    assertPasswordIsCompliant(context.credentials['password'])
    test_client = context.test.client
    response = set_new_password(test_client, **context.credentials)
    context.test.assertEqual(context.expired_link,
                             response['data']['setPassword'])
Пример #4
0
def step_impl(context, amount, unit):
    expiration_delta_in_seconds = amount * unit
    check_that_email_is_received_soon_enough(context,
                                             expiration_delta_in_seconds)
    password_generator = RandomCompliantPasswordGenerator()
    context.credentials[
        'password'] = password_generator.get_compliant_password()
    assertPasswordIsCompliant(context.credentials['password'])
    test_client = context.test.client
    context.response = set_new_password(test_client, **context.credentials)
Пример #5
0
def step_impl(context):
    password_generator = RandomCompliantPasswordGenerator()
    context.credentials[
        'password'] = password_generator.get_compliant_password()
    assertPasswordIsCompliant(context.credentials['password'])
    test_client = context.test.client
    response = set_new_password(test_client, **context.credentials)
    context.test.assertEqual(response, context.successful_set_password)
    context.current_user[
        'encrypted_password'] = get_current_encrypted_password(
            context.current_user['email'])
Пример #6
0
def step_impl(context, amount, unit):
    expiration_delta_in_seconds = amount * unit
    datetime_after_expiration = context.email_reception_time + \
        timedelta(seconds=expiration_delta_in_seconds)
    with freeze_time(datetime_after_expiration):
        password_generator = RandomCompliantPasswordGenerator()
        context.credentials[
            'password'] = password_generator.get_compliant_password()
        assertPasswordIsCompliant(context.credentials['password'])
        test_client = context.test.client
        context.response = set_new_password(test_client, **context.credentials)
Пример #7
0
def step_impl(context):
    context.current_user = deepcopy(context.inactive_customer)
    assertPasswordIsCompliant(context.current_user['password'])
    test_client = context.test.client
    context.response = signup(test_client, **context.current_user)