Skip to content

Instantly share code, notes, and snippets.

Feature: Division
In order to avoid silly mistakes
Cashiers must be able to calculate a fraction
Scenario: Regular numbers
Given I have entered 3 into the calculator
And I have entered 2 into the calculator
When I press divide
Then the result should be 1.5 on the screen
from freshen import *
from freshen.checks import *
@After('@raises_exception')
def raises_exception(sc):
raise Exception('An error ocurred')
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>Lista de remédios</title>
</head>
<body id="">
<ul>
{% for remedio in remedios %}
<li>{{ remedio.nome }}</li>
{% endfor %}
@Given('I have an attribute stored in world')
def i_have_an_attirbute_stored_in_world(step):
world._name = 'My name' # This line stores _name in world
world._name = 'His name' # This line raises an exception
RewriteEngine on
RewriteCond $1 !^(index\.php|unit_test\.php|images|robots\.txt|static|.*\.css)
RewriteRule ^(.*)$ index.php/$1 [L]
{% extends "base.html" %}
{% block content %}
<p>Fill the form bellow to login in the system ;)</p>
{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}
{% extends "base.html" %}
{% block content %}
Bye :)
{% endblock %}
{% extends "base.html" %}
{% block content %}
<form action="{% url core.views.new_post %}" method="post" accept-charset="utf-8">
{% csrf_token %}
{{ form.as_p }}
<p><input type="submit" value="Post!"/></p>
</form>
{% endblock %}
{% extends "base.html" %}
{% block content %}
<dl>
{% for post in posts %}
<dt>{{ post.title }} (written by {{ post.user.username }})</dt>
<dd>{{ post.content }}</dd>
{% endfor %}
</dl>
{% endblock %}
{{extend 'layout.html'}}
<h1 id="">Listing all posts</h1>
<dl>
{{for post in posts:}}
<dt>{{=post.title}} (written by {{=post.author.first_name}})</dt>
<dd>{{=post.content}}</dd>
{{pass}}
</dl>