Exemple #1
0
def get_pasta(user, key):
    pasta = modelo.get_pasta(user, key)
    if pasta is None:
        abort(404)

    return render_template("pasta.html",
                           pasta=pasta["code"],
                           user=user,
                           key=key)
Exemple #2
0
def get_pasta_with_sauce(user, key, lexer):
    pasta = modelo.get_pasta(user, key)
    if pasta is None:
        abort(404)

    with_sauce = modelo.pasta_with_sauce(pasta, lexer)
    return render_template("pasta-sauce.html",
                           pasta=with_sauce["code"],
                           user=user,
                           key=key)
Exemple #3
0
def test_get_pasta():
    with patch('modelo.pastas.find_one') as p:
        modelo.get_pasta(1,2)
        p.assert_called_with(user=1, key=2)