Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 def post(self, wall_id):
     try:
         wall_obj = json.loads(self.request.body)
         try:
             item = walls.add_url(wall_id, wall_obj['url'])
             self.respond_created(item_uri(item))
         except ValueError:
             self.respond_bad_request('Url was malformed')
     except ValueError:
         self.respond_bad_request('Request did not contain valid JSON')
Example #4
0
 def post(self, wall_id):
     try:
         wall_obj = json.loads(self.request.body)
         try:
             item = walls.add_url(wall_id, wall_obj['url'])
             self.respond_created(item_uri(item))
         except ValueError:
             self.respond_bad_request('Url was malformed')
     except ValueError:
         self.respond_bad_request('Request did not contain valid JSON')
Example #5
0
 def test_bad_url(self):
     walls.add_url(self.wall, BAD_URL)
Example #6
0
 def test_bad_url(self):
     walls.add_url(self.wall, BAD_URL)
Example #7
0
 def setup(self):
     self.wall = walls.create(WALL_NAME)
     self.item = walls.add_url(self.wall.unique_id,
                               'http://www.testurl.com')
     self.url = '/res/collections/%s' % self.wall.unique_id
Example #8
0
 def setup(self):
     self.wall = walls.create(WALL_NAME)
     self.item = walls.add_url(self.wall.unique_id, 'http://www.testurl.com')
     self.url = '/res/collections/%s' % self.wall.unique_id