Commit 3665fc3f authored by Bezleputh's avatar Bezleputh Committed by hydrargyrum
Browse files

[750g] get recipe from full url

parent cfea89f1
......@@ -37,8 +37,10 @@ class SevenFiftyGramsBrowser(PagesBrowser):
def iter_recipes(self, pattern):
return self.search.go(pattern=quote_plus(pattern.encode('utf-8')), page=1).iter_recipes()
def get_recipe(self, id, recipe=None):
self.recipe.go(id=id)
@recipe.id2url
def get_recipe(self, url, recipe=None):
self.location(url)
assert self.recipe.is_here()
return self.get_recipe_content(recipe)
def get_comments(self, id):
......
......@@ -31,4 +31,3 @@ def test_recipe(self):
self.assertTrue(full_recipe.instructions, 'No instructions for %s' % recipe.id)
self.assertTrue(full_recipe.ingredients, 'No ingredients for %s' % recipe.id)
self.assertTrue(full_recipe.title, 'No title for %s' % recipe.id)
self.assertTrue(full_recipe.preparation_time, 'No preparation time for %s' % recipe.id)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment