示例#1
0
    def update_tours():
        print("\n\033[01m## Updating ##\033[0m")
        make_test(lambda: TourController.add_document(1, 1))(
            GuidedTourTest, "adding existing document", False)

        make_test(lambda: TourController.add_document(1, 1))(
            GuidedTourTest, "adding twice existing document", False)

        make_test(lambda: TourController.add_document(1, 2))(
            GuidedTourTest, "adding existing document", False)

        make_test(lambda: TourController.add_document(2, 1))(
            GuidedTourTest, "adding existing document", False)

        make_test(lambda: TourController.add_document(1, 3))(
            GuidedTourTest, "adding non existing document", True)

        make_test(lambda: TourController.add_document(-1, 3))(
            GuidedTourTest, "adding non existing document", True)

        make_test(
            lambda: TourController.update(1, {
                'title': 'this is a new title',
                'description': 'new description'
            }))(GuidedTourTest, "updating existing guided tour", False)

        make_test(lambda: TourController.update_document(
            1, 1, {'text1': 'this is a text'}))(
                GuidedTourTest, "updating guided tour document", False)
 def test_update_tour_4(self):
     print("updating existing guided tour")
     response = TourController.update(1, {'description': 'new description'})
     assert response['description'] == 'new description'
示例#3
0
def update_guided_tour(tour_id):
    updated_tour = TourController.update(tour_id, request.form)
    return ResponseOK(updated_tour)
示例#4
0
def update_guided_tour(tour_id):
    return send_response(
        lambda: TourController.update(tour_id, request.form))()