def test_add_two_urls(self): walls.add_url(self.wall.unique_id, URL1) walls.add_url(self.wall.unique_id, URL2) w = walls.fetch(self.wall.unique_id) eq_(w.items.count(), 2) eq_(w.items[0].url, URL1) eq_(w.items[1].url, URL2)
def put(self, wall_id): try: wall_obj = json.loads(self.request.body) wall = walls.fetch(wall_id) wall.name = wall_obj['name'] wall.name_set = True wall.put() self.respond_no_content() except ValueError: self.respond_bad_request('Request did not contain valid JSON')
def get(self, wall_id): wall = walls.fetch(wall_id) if wall: self.respond('wall.html', {'wall': wall}) else: self.respond_not_found()
def test_find_wall(self): w = walls.fetch(self.wall.unique_id) assert self.wall.name == w.name
def get(self, wall_id): w = walls.fetch(wall_id) if w: self.respond_json(w) else: self.respond_not_found()