Exemple #1
0
def step_impl(context, role):
    u = UserFactory(username=role)
    u.set_password('bar')
    u.save()
    p = Profile.objects.get(user_id=u.id)
    p.role = role
    p.save()
def step_impl(context):
    from django.contrib.auth.models import User

    # Creates a dummy user for our tests (user is not authenticated at this point)
    u = UserFactory(username='******', email='*****@*****.**')
    u.set_password('bar')

    # Don't omit to call save() to insert object in database
    u.save()
Exemple #3
0
def step_impl(context):
    # from django.contrib.auth.models import User

    # Creates a dummy user for our tests (user is not authenticated at this point)
    u = UserFactory(username='******', email='*****@*****.**')
    u.set_password('bar')

    # Don't omit to call save() to insert object in database
    u.save()
Exemple #4
0
def step_impl(context):
    from django.contrib.auth.models import User

    # Creates a dummy user for our tests (user is not authenicated at this point)
    u = UserFactory(username='******', email='*****@*****.**')
    u.set_password('password')

    # Do not fail to call save() to insert object in database
    u.save()
Exemple #5
0
def step_impl(context):
    from app.models import Usuario

    # Creates a dummy user for our tests (user is not authenticated at this point)
    u = UserFactory(cpf='foo', password='******')
    u.set_password('bar')

    # Don't omit to call save() to insert object in database
    u.save()
Exemple #6
0
def step_impl(context, role):
    u = UserFactory(username=role)
    u.set_password('bar')
    u.save()
    p = Profile.objects.get(user_id=u.id)
    if role == 'mentor':
        p.role = json.dumps(['worker', 'mentor'])
    elif role == 'task_updater/auditor':
        p.role = json.dumps((['task_updater', 'auditor']))
    else:
        p.role = json.dumps([role])
    p.save()
Exemple #7
0
def the_user_with_and_password(context, email, password):
    user = UserFactory(email=email)
    user.set_password(password)
    user.save()
    assert_that(user, not_none)
    context.user = user
    response = APIClient.login(
        username=email,
        password=password
    )

    assert_that(response, not_none)
Exemple #8
0
def step_impl(context):
    u = UserFactory(username='******', email='*****@*****.**')
    u.set_password('bar')
    # Don't omit to call save() to insert object in database
    u.save()
Exemple #9
0
def step_impl(context):
    user = UserFactory(username='******', email='*****@*****.**')
    user.set_password('bar')
    user.save()
Exemple #10
0
def criarNovoUsuario():
    # Creates a dummy user for our tests (user is not authenticated at this point)
    u = UserFactory(username='******', email='*****@*****.**')
    u.set_password('bar')
    # Don't omit to call save() to insert object in database
    u.save()