Exemplo n.º 1
0
 def test_get_name(self, api_authed):
     post = Post.new(api_authed)
     req = application.get('/api/02/posts?name=' + post.owner.name)
     assert req.status_int == 200
     assert req.json['success'], req.json
     assert 'html' in req.json
     assert req.json['ids'] == [str(post.id)]
Exemplo n.º 2
0
 def test_delete(self, api_authed):
     # Not using the fixture here
     objects = [Post.new(api_authed)]
     req = application.delete_json('/api/02/posts',
                                   params={'ids': [str(o.id) for o in objects]})
     assert req.status_int == 200
     assert req.json['success'], req.json
     assert all(not Post(o.id).good() for o in objects)