from behave import *

use_step_matcher("parse")


@given('Exists a user "{username}" with password "{password}"')
def step_impl(context, username, password):
    from django.contrib.auth.models import User
    User.objects.create_user(username=username, email='user@example.com', password=password)

@given('I login as user "{username}" with password "{password}"')
def step_impl(context, username, password):
    context.browser.visit(context.get_url('/accounts/login/'))
    form = context.browser.find_by_tag('form').first

    context.browser.fill('username', username)
    context.browser.fill('password', password)

    form.find_by_css('button.btn-post').first.click()

@then('I\'m viewing user "{username}" workspace')
def step_impl(context, username):
    assert context.browser.is_text_present(username)



a6fad21a27b81ccec33fd3f5ee500d41d4ce3f1c
<mask token>


@given('Exists a user "{username}" with password "{password}"')
def step_impl(context, username, password):
    from django.contrib.auth.models import User
    User.objects.create_user(username=username, email='user@example.com',
        password=password)


<mask token>


@then('I\'m viewing user "{username}" workspace')
def step_impl(context, username):
    assert context.browser.is_text_present(username)

<mask token>


@given('Exists a user "{username}" with password "{password}"')
def step_impl(context, username, password):
    from django.contrib.auth.models import User
    User.objects.create_user(username=username, email='user@example.com',
        password=password)


@given('I login as user "{username}" with password "{password}"')
def step_impl(context, username, password):
    context.browser.visit(context.get_url('/accounts/login/'))
    form = context.browser.find_by_tag('form').first
    context.browser.fill('username', username)
    context.browser.fill('password', password)
    form.find_by_css('button.btn-post').first.click()


@then('I\'m viewing user "{username}" workspace')
def step_impl(context, username):
    assert context.browser.is_text_present(username)

<mask token>
use_step_matcher('parse')


@given('Exists a user "{username}" with password "{password}"')
def step_impl(context, username, password):
    from django.contrib.auth.models import User
    User.objects.create_user(username=username, email='user@example.com',
        password=password)


@given('I login as user "{username}" with password "{password}"')
def step_impl(context, username, password):
    context.browser.visit(context.get_url('/accounts/login/'))
    form = context.browser.find_by_tag('form').first
    context.browser.fill('username', username)
    context.browser.fill('password', password)
    form.find_by_css('button.btn-post').first.click()


@then('I\'m viewing user "{username}" workspace')
def step_impl(context, username):
    assert context.browser.is_text_present(username)

from behave import *
use_step_matcher('parse')


@given('Exists a user "{username}" with password "{password}"')
def step_impl(context, username, password):
    from django.contrib.auth.models import User
    User.objects.create_user(username=username, email='user@example.com',
        password=password)


@given('I login as user "{username}" with password "{password}"')
def step_impl(context, username, password):
    context.browser.visit(context.get_url('/accounts/login/'))
    form = context.browser.find_by_tag('form').first
    context.browser.fill('username', username)
    context.browser.fill('password', password)
    form.find_by_css('button.btn-post').first.click()


@then('I\'m viewing user "{username}" workspace')
def step_impl(context, username):
    assert context.browser.is_text_present(username)

from behave import *

use_step_matcher("parse")


@given('Exists a user "{username}" with password "{password}"')
def step_impl(context, username, password):
    from django.contrib.auth.models import User
    User.objects.create_user(username=username, email='user@example.com', password=password)

@given('I login as user "{username}" with password "{password}"')
def step_impl(context, username, password):
    context.browser.visit(context.get_url('/accounts/login/'))
    form = context.browser.find_by_tag('form').first

    context.browser.fill('username', username)
    context.browser.fill('password', password)

    form.find_by_css('button.btn-post').first.click()

@then('I\'m viewing user "{username}" workspace')
def step_impl(context, username):
    assert context.browser.is_text_present(username)


