Exemplo n.º 1
0
def post_event():
    global current_event
    global current_user
    current_event = read_event()
    if not current_user:
        add_output("You have to login first! \n")
    else:
        result = EventController.post_event(current_user, current_event)
        if result == Errors.DUPLICATE.name:
            add_output("A same event already exists! \n")
        elif result == Errors.FAILURE.name:
            return_failure()
        current_event.eid = result
        result = EventController.host_event(current_user, current_event)
        if result == Errors.DUPLICATE.name:
            add_output("A same event already exists! \n")
        elif result == Errors.FAILURE.name:
            return_failure()
    return
Exemplo n.º 2
0
    def test_post_event(self):
        event_id_1 = EventController.post_event(self.user_1, self.event_1)

        self.assertIsNotNone(event_id_1)