Ejemplo n.º 1
0
    def delete_tours():
        print("\n\033[01m## Deletion ##\033[0m")
        make_test(lambda: TourController.delete_tour(3))(GuidedTourTest,
                                                         "existing document",
                                                         False)

        make_test(lambda: TourController.delete_tour(3))(GuidedTourTest,
                                                         "existing document",
                                                         True)
Ejemplo n.º 2
0
 def test_delete_tour_1(self):
     print("existing tour")
     expected = {
         'extendedDocs': [],
         'name': 'Third tour',
         'id': 3,
         'description': 'This is the third guided tour'
     }
     assert TourController.delete_tour(3) == expected
Ejemplo n.º 3
0
 def test_delete_tour_2(self):
     print("non existing tour")
     with pytest.raises(sqlalchemy.orm.exc.NoResultFound):
         TourController.delete_tour(3)
Ejemplo n.º 4
0
def delete_tour(doc_id):
    deleted_tour = TourController.delete_tour(doc_id)
    return ResponseOK(deleted_tour)
Ejemplo n.º 5
0
def delete_tour(doc_id):
    return send_response(lambda: TourController.delete_tour(doc_id))()