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)
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)
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)